Skip to content

Instantly share code, notes, and snippets.

Print GitHub Markdown Bookmarklet

javascript:document.body.appendChild(document.querySelector("#readme"));document.querySelector("header").remove();document.querySelector(".application-main").remove();document.querySelector("footer").remove();window.print();

Make it into a bookmarklet. It removes everything around the markdown article and opens the print dialog.

export const errorCodes = {
'E00000000': 'This is for communication confirmation, so no action is required. ',
'E00000001': 'An error corresponding to HTTP status code 405. HTTP method is not POST. ',
'E00000002': 'An error corresponding to HTTP status code 406. Accept related items of HTTP request header are not correct. ',
'E00000003': 'An error corresponding to HTTP status code 415. The Content-type item in the HTTP request header is incorrect. ',
'E00000010': 'HTTP content is empty or malformed. ',
'E01010001': 'Shop ID is not specified. ',
'E01010008': 'The shop ID contains non-alphanumeric characters or exceeds 13 characters. ',
'E01010010': 'Shop ID does not match. ',
@xpepper
xpepper / LondonVsChicago.md
Last active March 21, 2025 13:52
London vs Chicago, Comparative Case Study - Sandro Mancuso and Uncle Bob

My notes on the video series "London vs Chicago TDD styles" by Uncle Bob And Sandro Mancuso

The git repo of the kata is here: https://github.com/sandromancuso/cleancoders_openchat/

The "starting-point" branch is where both implementations began: https://github.com/sandromancuso/cleancoders_openchat/tree/starting-point

  • The 🇬🇧 "openchat-outside-in" branch captures the tomato by tomato history of the London approach.
  • The 🇺🇸 "openchat-unclebob" branch captures the tomato by tomato history of the Chicago approach.

What I like about Sandro's style 👍

@patrickelectric
patrickelectric / video_udp.py
Last active July 17, 2025 13:41
Get video from gstreamer udp with python and visualize with OpenCV
#!/usr/bin/env python
import cv2
import gi
import numpy as np
gi.require_version('Gst', '1.0')
from gi.repository import Gst
@crossan007
crossan007 / 32to2.sh
Created December 22, 2017 03:18
Allen Heath QU32 GStreamer extract two channels
#!/bin/bash
/usr/share/voctomix-outcasts/ingest.py --custom-pipeline \
"videotestsrc pattern=2 ! queue ! videoconvert ! videorate ! videoscale ! \
video/x-raw,format=I420,width=1920,height=1080,framerate=30/1,pixel-aspect-ratio=1/1 ! \
queue ! mux. \
alsasrc name=audiosrc device=hw:CARD=QU32,DEV=0 provide-clock=false slave-method=re-timestamp ! \
audio/x-raw,channels=32,layout=interleaved,rate=48000 ! queue ! \
deinterleave name=d \
interleave name=i \
@sgelbart
sgelbart / firebase-example.html
Created December 10, 2017 22:39
A simple firebase example for reading and writing database records realtime.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Order Form</title>
@slobdell
slobdell / auto_mount_usb.py
Created November 11, 2017 23:31
Automatically mount USB drive in python script
import commands
# ASSUMED THAT THIS COMMAND HAS ALREADY BEEN RUN
# sudo mkdir /mnt/usb_stick
MOUNT_DIR = "/mnt/usb_stick"
def run_command(command):
# start = time.time()
ret_code, output = commands.getstatusoutput(command)
@nasirkhan
nasirkhan / laravel-controller-method-commands.php
Last active March 10, 2025 14:22
Call Laravel Controller methods via command line
<?php
php artisan tinker
$controller = app()->make('App\Http\Controllers\MyController');
app()->call([$controller, 'myMethodName'], []);
//the last [] in the app()->call() can hold arguments such as [user_id] => 10 etc'
@mrkhoa99
mrkhoa99 / GMO Payment Gateway Magento 2
Created July 19, 2016 10:48
The API does not return error messages, so I translated these from the example english-like messages in the GMO documentation
#Resource reference: https://docs.omniref.com/github/veracross/active_merchant/HEAD/symbols/ActiveMerchant::Billing::GmoGateway#line=46
# The API does not return error messages, so I translated these from the
# example english-like messages in the GMO documentation
ERROR_CODES = {
'E01010001' => 'Shop ID not specified',
'E01010008' => 'Shop ID contains invalid characters or is too long',
'E01010010' => 'Shop ID is invalid',
'E01020001' => 'Shop Password not specified',
'E01020008' => 'Shop Password contains invalid characters or is too long',
'E01030002' => 'Shop ID and Password are invalid',
@strezh
strezh / GStreamer-1.0 some strings.sh
Last active October 16, 2024 13:31
GStreamer-1.0 personal cheat sheet
#!/bin/bash
# play YUV444 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y444 ! \
videoconvert ! \
autovideosink
# play YUV422 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \