Skip to content

Instantly share code, notes, and snippets.

View vayn's full-sized avatar

Vayne Tsai vayn

View GitHub Profile
@jasonm23
jasonm23 / README.md
Last active September 10, 2020 20:00 — forked from hamann/gist:39371c46806e14ab3853
Elixir mix oh-my-zsh completion plugin

Elixir Mix Oh-My-Zsh plugin

Copy the folder ./elixir_mix/ to ~/.oh-my-zsh/custom/plugins/ and add _elixir_mix to your .zshrc plugins list. e.g.

Example:

plugins=(
  autojump
 git
@rcugut
rcugut / node-npm-install.md
Last active February 2, 2024 11:51 — forked from DanHerbert/fix-homebrew-npm.md
Install node & npm on Mac OS X with Homebrew

DEPRECATED as of macOS 10.13 (High Sierra). See the new GUIDE to install nvm and yarn for macOS (updated July 2019)

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

@WeZZard
WeZZard / UIView+HitTestLiveTracing.h
Last active November 24, 2016 18:12
Lively trace UIView's hit testing
//
// UIView+LiveHitTestTracing.h
// UIViewLiveHitTestTracing
//
// Created by Manfred on 10/28/15.
//
//
@import UIKit;
@Daemon-Devarshi
Daemon-Devarshi / PasteboardWatcher.swift
Last active October 6, 2023 14:15
A class which performs polling to determine the newly copied url of desired kind in an external app
//
// PasteboardWatcher.swift
// PasteboardWatcher
//
// Created by Devarshi Kulshreshtha on 6/19/15.PasteboardWatcher
// Copyright © 2015 Devarshi Kulshreshtha. All rights reserved.
//
import Cocoa
@mahmoudimus
mahmoudimus / anaconda-mode.md
Created March 28, 2015 21:51
Emacs' anaconda-mode on MacOSX with Brewed Python

Background

You installed anaconda-mode and you've enabled it for use in Emacs. You also used homebrew to install your python distrubution. You open up a python file with anaconda-mode on.

Issue

You see a quick flash of Blocking call to accept-process-output with quit inhibited!! across your minibuffer. You switch to *messages* to see the errors and you see:

Blocking call to accept-process-output with quit inhibited!! [52 times]
@iximiuz
iximiuz / flask_static_files_cache_invalidator.py
Last active October 28, 2019 18:56
Flask: add static file's cache invalidator param to URLs generated by url_for(). Blueprints aware.
""" Inspired by http://flask.pocoo.org/snippets/40/ """
app = Flask(__name__)
@app.url_defaults
def hashed_url_for_static_file(endpoint, values):
if 'static' == endpoint or endpoint.endswith('.static'):
filename = values.get('filename')
if filename:
if '.' in endpoint: # has higher priority
@vayn
vayn / cvimrc.vim
Last active April 11, 2019 06:11
Vayn's cVim setting
let blacklists = ["https://mail.google.com/* gi gt x r f"]
map H scrollLeft
map L scrollRight
map h previousTab
map l nextTab
map r reloadTabUncached
map u lastClosedTab
map R :restore<Space>
map , goBack
@vayn
vayn / cli-gojuon-exercise.py
Last active April 18, 2019 05:58
CLI Gojūon Exercise
#!/usr/bin/env python3
import random
import signal
import sys
"""帮助
输入 ? 显示正确答案
"""
TEST_COUNT = 0
@hzlzh
hzlzh / gist:eb87294712e78d4a96c4
Created June 24, 2014 06:36
Proxifier 走代理程序请求规则
"Alfred 2"; idea;Thunder*; iTerm; Terminal;php; Dropbox; Sparrow; "Sequel Pro"; python; ruby; wget; curl; GitHub; git-remote-https; npm; node; perl;prl*;itunes; sftp; whois;traceroute;stroke;ssh;ALiWangwang;MacUpdate*;git*;Git;fzs*;mail;flickr*;xulr*;imess*;com.apple.im*;Airmail;Adium;Prot*;Tokens;Ali*;Lite*;file*;ssh;ftp;Adobe*;PDApp*;Creative*;Vbox*;xulrunner;Virtual*;PDApp;Bit*;Domainers;fire*;plugin*;Atom*;Tokens;.com.realmacsoftware*;Xcode;java;httpd;
/*
Swift Programming Language Guide
"A Swift Tour" Solutions
https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/GuidedTour.html#//apple_ref/doc/uid/TP40014097-CH2-XID_1
These are the solutions to all the "experiments" in the pre-release Swift Programming Guide
(released on the same day Apple announced Swift). A couple of things worth noting:
1. Swift syntax, e.g. array declarations, has changed since I releasd these. So this code will
probably cause some errors when you paste it into a playground. Should be easy enough to fix