Skip to content

Instantly share code, notes, and snippets.

View ciphers.txt
maxogden / index.js
Last active Sep 11, 2015
generate rsa keypair and format public key in openssh format in javascript
View index.js
// warning you probably want `ssh-keygen -t ed25519` for most use cases. this method lacks secure prng and uses weak rsa
var keypair = require('keypair')
var forge = require('node-forge')
// generates new keypair (slow)
var pair = keypair()
// creates intermediate forge key object
var publicKey = forge.pki.publicKeyFromPem(pair.public)
silverwind / setClass.css
Last active Dec 17, 2015
Set a class once the DOM has fully loaded it
View setClass.css
@keyframes nodeInserted {
from { clip: rect(1px, auto, auto, auto); }
to { clip: rect(0px, auto, auto, auto); }
View ococat.css
body { background: #222 }
#octo #cat { fill: #fff }
#octo { position: fixed; height: 100%; width: 100% }
#octo .part {
animation-name: fade;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-timing-function: ease-out;
fill: #333;
View clipboard.js
var btn = document.getElementById("copy-button");
btn.addEventListener("click", clickHandler, false);
function clickHandler(e) {
LouCypher / gist:3218906
Last active May 26, 2016
Use external editor to edit style on Stylish extension
View gist:3218906
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
robcowie / .mpdconf
Last active Oct 16, 2017
Install mpd on OSX 10.8
View .mpdconf
## ~/.mdpconf
port "6600"
music_directory "~/Music/"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
log_file "~/.mpd/mpd.log"
pid_file "~/.mpd/"
state_file "~/.mpd/state"
#bind_to_address "~/.mpd/mpd.sock"
mafintosh /
Last active Jun 21, 2018
Resets the npm defaults to how they used to be
npm config set loglevel http
npm config set progress false
npm config set package-lock false
npm config set save false
mkdir -p ~/.config/configstore/
printf '{"optOut": true,"lastUpdateCheck": 0}' > ~/.config/configstore/update-notifier-npm.json
sindresorhus /
Last active Nov 14, 2019
shell function for publishing node modules with some goodies
# npm publish with goodies
# prerequisite: `npm install -g trash`
# `np` with an optional argument `patch`/`minor`/`major`/`<version>`
# defaults to `patch`
np() {
trash node_modules &>/dev/null;
git pull --rebase &&
npm install &&
npm test &&
npm version ${1:-patch} &&
rvagg /
Last active Feb 23, 2021 - simple script to fetch and install Node.js releases and nightlies on Linux (x86, x64 & ARM) and OS X
# Note your /usr/local will need to be writable by the user running it,
# alternatively run it with `sudo`
hasxz=$(which xzcat)
os=$(uname | tr '[A-Z]' '[a-z]')
arch=$(uname -m)