A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
import mongoose from 'mongoose'; | |
let schema = new mongoose.Schema({ | |
email: { type: String, required: true, unique: true }, | |
password: { type: String, required: true } | |
}); | |
schema.statics.findOrCreate = async (conditions, opt_attr) => { | |
let document = await User.findOne(conditions); |
#!/usr/bin/env sh | |
echo "Creating a self-signed certificate..." | |
openssl req -new -newkey rsa:2048 -sha1 -days 3650 -nodes -x509 -subj "/C=US/ST=Georgia/L=Atlanta/O=BNR/CN=localhost.ssl" -keyout config/server.key -out config/server.crt | |
if ! grep -q "\blocalhost\.ssl\b" /private/etc/hosts; then | |
echo "Adding localhost.ssl to your hosts file..." | |
echo "127.0.0.1 localhost.ssl" | sudo tee -a /private/etc/hosts | |
fi |
importScripts('spark-md5.min.js'); | |
function calcMD5(f) { | |
var blobSlice = Blob.prototype.slice; | |
var chunkSize = 2097152; | |
var chunks = Math.ceil(f.size/chunkSize); | |
var spark = new SparkMD5.ArrayBuffer(); | |
var currentChunk = 0; | |
var fr = new FileReader(); |
import difflib | |
import pygments | |
import pygments.lexers | |
import pygments.formatters | |
def read_file(fn): | |
with open(fn) as f: | |
return f.read() |
# first: | |
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
# go to /usr/local/lib and delete any node and node_modules | |
cd /usr/local/lib | |
sudo rm -rf node* |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Single-Column Responsive Email Template</title> | |
<style> | |
@media only screen and (min-device-width: 541px) { | |
.content { |
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |