Skip to content

Instantly share code, notes, and snippets.


Tom Saleeba tomsaleeba

View GitHub Profile
hanayashiki / patch-arrayBuffer.js
Created Dec 16, 2019
Safari 13.0.4: Blob.arrayBuffer is not a function
View patch-arrayBuffer.js
(function () {
File.prototype.arrayBuffer = File.prototype.arrayBuffer || myArrayBuffer;
Blob.prototype.arrayBuffer = Blob.prototype.arrayBuffer || myArrayBuffer;
function myArrayBuffer() {
// this: File or Blob
return new Promise((resolve) => {
let fr = new FileReader();
fr.onload = () => {
bittner /
Created Feb 28, 2019
Keyboard keys markup in MarkDown

Ctrl + Alt + Space

andyrbell /
Last active Jan 26, 2022
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
Gomah / Dockerfile
Last active Mar 23, 2021
Nuxt.js Dockerfile ::
View Dockerfile
FROM node:10-alpine
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
COPY package.json /usr/src/app/
COPY yarn.lock /usr/src/app/
RUN yarn install
#!/usr/bin/env python3
The idea here is to have one demo of each common argparse format
type. This is useful for me to be able to copy/paste into a new
script and have something to quickly edit and trim down to get
the functionality I need.
Expect this file to grow/change as I need new options.
This is, however, a working example. I hate examples that don't
javilobo8 / download-file.js
Last active Jan 27, 2022
Download files with AJAX (axios)
View download-file.js
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
View map-reduce-example.groovy
// Groovy map-reduce example
// declare a closure
def half = { it ->
it / 2
// declare another closure
def sum = { result, i ->
result + i
itod /
Last active Jan 26, 2022
Every "split" mechanical keyboard currently being sold that I know of
rgl /
Last active Jan 12, 2022
Wait for an HTTP endpoint to return 200 OK with Bash and curl
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done'
# also check
ankurk91 /
Last active Jan 27, 2022
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with