Skip to content

Instantly share code, notes, and snippets.

View minhoryang's full-sized avatar
😍
Happy Today!

Minho Ryang minhoryang

😍
Happy Today!
View GitHub Profile
@kinkerl
kinkerl / mosh.sh
Created May 9, 2012 08:51
mosh failover to regular shell, took from https://github.com/keithw/mosh/issues/232
#!/usr/bin/env bash
mosh "$@"
[ $? -eq 5 ] && ssh "$@"
@voxxit
voxxit / hashicorp.consul.server.plist
Created August 7, 2015 22:01
LaunchAgent for Consul & Consul UI
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>hashicorp.consul.server</string>
<key>ProgramArguments</key>
<array>
@lifthrasiir
lifthrasiir / xv.c
Last active December 10, 2015 10:38
Simplistic extensible vector (XV)
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
struct xv_base { ptrdiff_t xv__size, xv__alloc; };
#define XV(type) struct { struct xv_base xv__base; type *xv__ptr; }
#define XV_BASE(xv) ((xv).xv__base)
#define XV_SIZE(xv) (XV_BASE(xv).xv__size)
#define XV_ALLOC(xv) (XV_BASE(xv).xv__alloc)
@jonghwanhyeon
jonghwanhyeon / background.js
Last active December 15, 2015 03:39
Drag to open link in new tab
chrome.extension.onConnect.addListener(function (port) {
port.onMessage.addListener(openLink);
});
var openLink = (function () {
var openers = {
tab: function (information ) {
chrome.tabs.create({
url: information.url,
active: false
@dnordberg
dnordberg / gist:5658957
Created May 27, 2013 20:36
Routes for Swagger json resources.
from flask import Response
RE_API_DOCS_BASE_PATH = re.compile(r'"basePath": "(.*)\/api\/')
API_SANDBOX_URL = '"basePath": "http://localhost:5000/api/'
@app.route('/api/v1/api-docs', methods=['GET'])
def api_docs_index():
return Response(RE_API_DOCS_BASE_PATH.sub(API_SANDBOX_URL,
open('./docs/api/v1/index.json').read()),
mimetype='application/json')
@dnordberg
dnordberg / gist:5658936
Created May 27, 2013 20:30
Script used to help generate Swagger docs.
import re
import os
import argparse
import urlparse
import simplejson
from collections import defaultdict
from sqlalchemy.ext.declarative.api import DeclarativeMeta
SKIP_MODELS = ['BlogPost', 'BlogCategory', 'DBVersion']
@skyisle
skyisle / build.gradle
Last active December 19, 2015 23:49
Using annotation processing in gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
@lrstanley
lrstanley / media.php
Created December 13, 2013 13:38
Media based file indexer. (I.e, if you have a directory full of .png, .txt, or .doc, etc) this will cleanly list them (and remove the index.php from the list of files)
<!doctype html>
<html>
<head>
<title>File index</title>
<meta name="viewport" content="width=device-width">
<!--<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">-->
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootswatch/3.0.2/cosmo/bootstrap.min.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
</head>
@sairion
sairion / easing.js
Created January 22, 2014 08:18 — forked from gre/easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity