This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = "http://cdn1.giltcdn.com/images/share/uploads/0000/0001/7250/172502872/420x560.jpg"; | |
var encoded = new Buffer(url).toString('base64'); | |
var decoded = new Buffer(encoded, 'base64').toString('ascii') | |
console.log(encoded); | |
console.log(decoded); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Tiny init.vim for deoplete | |
" vim-plug | |
set runtimepath+=$XDG_CONFIG_HOME/nvim/plugged/deoplete.nvim | |
set completeopt+=noinsert,noselect | |
set completeopt-=preview | |
hi Pmenu gui=NONE guifg=#c5c8c6 guibg=#373b41 | |
hi PmenuSel gui=reverse guifg=#c5c8c6 guibg=#373b41 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Groovy map-reduce example | |
// declare a closure | |
def half = { it -> | |
it / 2 | |
} | |
// declare another closure | |
def sum = { result, i -> | |
result + i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const test = process.env.NODE_ENV === 'test'; | |
module.exports = { | |
plugins: [ | |
...(test ? ['babel-plugin-transform-import-meta'] : []) | |
] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DUBSTEP | |
# Combines ideas from my other gists | |
current_bpm = 140.0 | |
use_bpm current_bpm | |
# WOBBLE BASS | |
define :wob do | |
use_synth :dsaw | |
lowcut = note(:E1) # ~ 40Hz | |
highcut = note(:G8) # ~ 3000Hz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 = () => { | |
resolve(fr.result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Use AWS CLI to get the most recent version of an AMI that | |
# matches certain criteria. Has obvious uses. Made possible via | |
# --query, --output text, and the fact that RFC3339 datetime | |
# fields are easily sortable. | |
export AWS_DEFAULT_REGION=us-east-1 | |
aws ec2 describe-images \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Inspired by https://gist.github.com/jtangelder/e445e9a7f5e31c220be6 | |
# Python3 http.server for Single Page Application | |
import urllib.parse | |
import http.server | |
import socketserver | |
import re | |
from pathlib import Path |
OlderNewer