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
on alfred_script(q) | |
tell application "System Events" | |
set procName to "MOG" | |
if not (exists process procName) then | |
tell application procName to activate | |
else | |
not (visible of process procName) | |
set visible of process procName to the result | |
not visible of process procName | |
set frontmost of process procName to the result |
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 python | |
import argparse | |
import random | |
import string | |
import subprocess | |
arg_parser = argparse.ArgumentParser(description="Generate a random password and save it to the clipboard. OS X only.") | |
arg_parser.add_argument('length', type=int, default=20, nargs='?', help="Password length. (Default is 20.)") | |
arg_parser.add_argument('-s', '--simple', action='store_true', help="Letters and numbers only.") |
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
#include <openssl/rand.h> | |
#include <openssl/evp.h> | |
#define SECRETS_PBKDF2_ITERATIONS 10000 | |
#define AES_KEY_LEN 32 | |
bstring secrets_encrypt(bstring data, bstring password) { | |
int res = 0; | |
unsigned char salt[PKCS5_SALT_LEN] = {0}; |
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 python | |
from subprocess import call | |
import sys | |
import time | |
def ding(): | |
call(['afplay', '/System/Library/Sounds/Glass.aiff']) |
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
(function (factory) { | |
// Expose as AMD. | |
if( typeof define === "function" && define.amd ) { | |
define(['jquery', 'underscore', 'select'], factory); | |
} | |
// Expose as global. | |
else { | |
window.scope = factory(jQuery, _, select); | |
} |
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
import re | |
from itertools import groupby | |
# AA[0-9] encodes at most 11 input characters. | |
MAX_CHUNK_LEN = 11 | |
only_uppercase_letters = re.compile(r'^[A-Z]*$').search | |
def _compress_chunk(char, count): |
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
object App { | |
def main(args:Array[String]):Unit = args(0) match { | |
case "yan" => yan | |
case "levi" => levi | |
case "nick" => nick | |
case "nickbad" => nickbad | |
} | |
def yan = { | |
val r = Iterator.iterate(2L)(_+1) collectFirst { |
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
# Does it. | |
doit |
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
import argparse | |
import smtplib, os | |
import json | |
from email.MIMEMultipart import MIMEMultipart | |
from email.MIMEBase import MIMEBase | |
from email.MIMEText import MIMEText | |
from email import Encoders | |
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
# The first line is the heading, the rest are data. | |
# You can add more colums. Each column must be tab separated. | |
title password ... | |
gmail 12345 ... | |
linkedin 6578 ... | |
something really long 2134567 ... | |
# Once you have that in a file, you can import it: |
OlderNewer