Skip to content

Instantly share code, notes, and snippets.

@seungjin
seungjin / Dockerfile
Last active July 26, 2018 02:34
Dockerfile for seungjin/elixir:1.2.6-alpine
FROM alpine:3.6
# Download precompiled elixir at https://github.com/elixir-lang/elixir/releases/tag/v1.2.6
# sha256sum of elixir-1.2.6-Precompiled.zip: bb4324eb7c9568fa30f0f2ed3c1b86ebbd5251f7c820f1beb0e5eed5fb8a9729
COPY elixir-1.2.6-Precompiled.zip /tmp/
RUN set -xe \
&& apk update \
&& apk add erlang=19.3.0-r3 \
&& unzip /tmp/elixir-1.2.6-Precompiled.zip -d /
https://help.ubuntu.com/community/MacBookPro11-1/Saucy#Won.27t_stay_suspended
Won't stay suspended
If your laptop wakes up on its own a minute or two after suspending (just long enough for you to put it in your bag where it can wake up and start overheating!) then disable "wake from USB" -- presumably the keyboard, trackpad, or some other internal component is waking up.
To disable "wake from USB":
echo XHC1 | sudo tee /proc/acpi/wakeup
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
################################################################################
##
## SSH multiplexing will boost your sync time!
## If you don't know about ssh multiplxing, google it.
## You will get lots of benefit from it
##
import sys
import time
@seungjin
seungjin / has_element2.ml
Last active October 10, 2015 10:00
has_element function
let rec has_element2 l e =
match l with
| [] -> false
| h::t -> h = e || has_element2 t e
;;
@seungjin
seungjin / github-pandoc.css
Last active August 26, 2015 08:02 — forked from dashed/github-pandoc.css
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@seungjin
seungjin / gfwlist.js
Last active August 29, 2015 14:08
my gfwlist.js
// Made this for my China stay
// My collection of domains
// Generated by gfwlist2pac
// https://github.com/clowwindy/gfwlist2pac
var domains = {
"blogspot.com": 1,
"googleusercontent.com": 1,
"blogger.com": 1,
#!/bin/env python27
# -- coding: utf-8 --
import dataset
from sqlalchemy.exc import OperationalError
import time
class Local_storage:
def __init__(self):
#!/bin/env python27
# -- coding: utf-8 --
import requests
import dataset
from sqlalchemy.exc import OperationalError
import time
from bs4 import BeautifulSoup
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import json
import smtplib, os
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText