Skip to content

Instantly share code, notes, and snippets.

@alyssaq
alyssaq / 1. Install python3.7 & pip3.md
Last active April 11, 2023 02:13
Python3.7 setup on Mac 10.14 (Mojave)
  1. Install Python 3.7.x from https://www.python.org/downloads/ or via homebrew.
$ brew install python3   # Installed at /usr/local/Cellar/python3

Check that python3 has been installed by running it at the terminal:

$ python3
>>> Python 3.7.2
  1. Download get-pip.py from https://bootstrap.pypa.io/get-pip.py and install (this should already be installed if python was installed from python.org or homebrew):
@alyssaq
alyssaq / README.md
Last active October 20, 2015 04:54 — forked from mbostock/.block
Spectual Color Scale
@alyssaq
alyssaq / countries-continent.sql
Created October 16, 2015 16:43
Countries, country code, continent code SQL database dump
BEGIN;
create schema "1";
COMMIT;
CREATE TABLE "1".countries
(
code char(2),
name varchar(255),
continentcode char(2)
);
func renderTemplate(w http.ResponseWriter, tmpl string, str string) {
var fp = path.Join("templates", "index.html")
var templates = template.Must(template.ParseFiles(fp))
err := templates.ExecuteTemplate(w, tmpl+".html", str)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}
@alyssaq
alyssaq / .vimrc
Created May 4, 2015 02:04
.vimrc
set encoding=utf-8
autocmd! bufwritepost .vimrc source %
filetype off
filetype plugin indent on
syntax on
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType javascript setlocal shiftwidth=2 tabstop=2
@alyssaq
alyssaq / config.fish
Created April 30, 2015 03:54
config.fish set environment variables from bash_profile
# Fish shell
egrep "^export " ~/.bash_profile | while read e
set var (echo $e | sed -E "s/^export ([A-Z_]+)=(.*)\$/\1/")
set value (echo $e | sed -E "s/^export ([A-Z_]+)=(.*)\$/\2/")
# remove surrounding quotes if existing
set value (echo $value | sed -E "s/^\"(.*)\"\$/\1/")
if test $var = "PATH"
@alyssaq
alyssaq / .bash_alias
Last active May 3, 2017 09:47
.bash_profile
alias ls="ls -hFG"
alias ll="ls -lAhBG"
alias pyserver="python -m SimpleHTTPServer 2000"
alias subl="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
# Postgres. To use: pgserver [start|stop|status]
alias pgserver="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log"
@alyssaq
alyssaq / separate_app_external-vendor_bundles.js
Created April 15, 2015 04:00
Browserify - separate app and enternal vendor bundles from package.json
var babelify = require('babelify')
var browserify = require('browserify')
var source = require('vinyl-source-stream')
var buffer = require('vinyl-buffer')
var globalShim = require('browserify-global-shim').configure({
'm': 'm',
'Auth0Lock': 'Auth0Lock',
'Papa': 'Papa'
});
@alyssaq
alyssaq / public_s3.xml
Created April 12, 2015 05:18
Public s3 bucket for static site
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "Stmt1380877761162",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
@alyssaq
alyssaq / gulpfile.js
Last active February 13, 2024 07:55
browserify, babel, gulp, glob, vinyl-source-stream, uglify
/*
npm install gulp gulp-load-plugins gulp-uglify
npm install browserify babelify glob vinyl-source-stream vinyl-buffer
More examples: https://github.com/gulpjs/gulp/tree/master/docs/recipes
*/
var gulp = require('gulp')
var $ = require('gulp-load-plugins')()
var browserify = require('browserify')