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 inputStream = process.stdin; | |
function readHeader(stream) { | |
let buffer = stream.read(44); | |
const chunkId = buffer.slice(0, 4).toString(); | |
const chunkSize = buffer.readUInt32LE(4); | |
const format = buffer.slice(8, 12).toString(); | |
const subchunk1Id = buffer.slice(12, 16).toString(); | |
const subchunk1Size = buffer.readUInt32LE(16); |
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 bash | |
BRANCH=`git branch | grep '^\*' | cut -b3-` | |
REFS=`echo "$BRANCH" | sed -E 's/^[^_]+_([0-9]+)_.+$/\1/'` | |
echo "Refs #$BRANCH - " > $1 |
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 axios = require('axios'); | |
const cheerio = require('cheerio'); | |
const childProcess = require('child_process'); | |
(async () => { | |
const {data: npmListHtml} = await axios.get('https://www.npmjs.com/browse/depended/lodash'); | |
const $ = cheerio.load(npmListHtml); | |
const npmPackageLinks = $('section a').map((i, elem) => $(elem).attr('href')).get(); | |
childProcess.execSync(`rm -rf ${__dirname}/packages`); |
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
# You have to install mime package | |
# npm install -g mime | |
function base64urldata | |
set filename $argv[1] | |
echo "data:"(mime $filename)";base64,"(cat $filename | openssl enc -base64 | tr -d '\n') | |
end |
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
npm install -g npm@latest |
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
Windows Registry Editor Version 5.00 | |
[HKEY_CURRENT_USER\Software\AgileBits\1Password 4] | |
"VerifyCodeSignature"=dword:00000000 |
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
# Existing stuff | |
alias chrome-audio="osascript -e \"do shell script \\\"open '/Applications/Google Chrome.app' --args --audio-buffer-size=8192\\\"\"" |
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 | |
sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT | |
sudo iptables -A INPUT -j DROP | |
sudo iptables -I INPUT 1 -i lo -j ACCEPT | |
sudo apt-get install iptables-persistent |
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 | |
# Extract certificate | |
openssl pkcs12 -clcerts -nokeys -in apns-prod-cert.p12 -out apns-prod-cert.pem | |
# Extract key | |
openssl pkcs12 -nocerts -in apns-prod-key.p12 -out apns-prod-key.pem | |
# Remove password from PEM key | |
openssl rsa -in apns-prod-key.pem -out apns-prod-key-noenc.pem |
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
only screen and (-webkit-min-device-pixel-ratio: 1) and (max-device-width: 320px), | |
only screen and ( min--moz-device-pixel-ratio: 1) and (max-device-width: 320px), | |
only screen and ( -o-min-device-pixel-ratio: 1/1) and (max-device-width: 320px), | |
only screen and ( min-device-pixel-ratio: 1) and (max-device-width: 320px), | |
only screen and ( min-resolution: 96dpi) and (max-device-width: 320px), | |
only screen and ( min-resolution: 1dppx) and (max-device-width: 320px), | |
only screen and (-webkit-min-device-pixel-ratio: 2) and (max-device-width: 640px), | |
only screen and ( min--moz-device-pixel-ratio: 2) and (max-device-width: 640px), | |
only screen and ( -o-min-device-pixel-ratio: 2/1) and (max-device-width: 640px), |
NewerOlder