Skip to content

Instantly share code, notes, and snippets.

View metafeather's full-sized avatar

Liam Clancy metafeather

View GitHub Profile
@benbjohnson
benbjohnson / README.md
Last active February 11, 2019 12:10
LuaJIT + Go Integration Test

Create an empty directory, download the code and run it:

$ mkdir /tmp/lj
$ cd /tmp/lj
$ wget https://gist.github.com/benbjohnson/5622779/raw/e53d227ebdbea8d513b62ad076feb3f6ac1c1594/luajit.go
$ go run luajit.go

And you should see:

@miguelgr
miguelgr / Preferences.json
Last active January 16, 2017 16:51
ST: user_settings
{
"close_windows_when_empty": false,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"font_face": "Menlo",
"font_options": ["subpixel_antialias", "no_bold"],
"font_size": 14.0,
"enable_live_count": true,
"highlight_modified_tabs": true,
"highlight_line": false,
"ignored_packages": [
@miguelgr
miguelgr / user-keymapl.json
Last active October 15, 2021 03:48
ST: sublime-keymap
/*
Created by: Miguel Garcia <[email protected]>
Date: 2013
Github: miguelgr
These keybindings are personalized in order to optimize the working time avoiding
using the mouse
They work with the following packages:
@benbjohnson
benbjohnson / lj.go
Created April 10, 2013 03:27
LuaJIT & Go Integration
package main
/*
#cgo LDFLAGS: -lluajit-5.1
#include <stdlib.h>
#include <luajit-2.0/lua.h>
#include <luajit-2.0/lualib.h>
#include <luajit-2.0/lauxlib.h>
int my_func() {
@aotimme
aotimme / pushstate.nginxconf
Last active June 3, 2022 19:37
Nginx config file to support pushState.
# pushState friendly!
# The setup:
# * website name is `site.com`
# * the API for your running on localhost:3000
# * the root for API calls is at `/api`, and you have authentication routes with root `/auth` (both go to localhost:3000)
# * javascript app is located at `/path/to/javascript/app`
# Assuming you have your server for API calls at localhost port 3000
upstream api_sitecom {
server localhost:3000;
@brianm
brianm / .gitignore
Last active April 26, 2024 07:34
Go net/rpc over ssh+netcat and unix domain sockets It would be nice if ssh.Session implemented io.ReaderWriter
local_client
server
client
ext
@paulie4
paulie4 / git-rm-files-from-index.sh
Last active December 11, 2015 20:09
Use this script to remove .gitignored files from a git repository's index, but to not remove the files locally. It should be run on all machines that need to preserve the .gitignored files, since a "git pull" or "git checkout <branch>" would remove them otherwise (original idea from http://www.arlocarreon.com/blog/git/untrack-files-in-git-repos-…
#/bin/bash
## Note: All machines should be up to date before any of them run this script,
## and at least one machine should have all the remote branches checked out.
## Use this script to remove .gitignored files from a git repository's index,
## but to not remove the files locally. It should be run on all machines that
## need to preserve the .gitignored files, since a "git pull" or "git checkout
## <branch>" would remove them otherwise (original idea from
## http://www.arlocarreon.com/blog/git/untrack-files-in-git-repos-without-deleting-them/).
@kaizhu256
kaizhu256 / gist:4482069
Last active October 20, 2021 16:25
javascript - very fast and simple uuid4 generator benchmarked on http://jsperf.com/uuid4/8
/*jslint bitwise: true, indent: 2, nomen: true, regexp: true, stupid: true*/
(function () {
'use strict';
var exports = {};
exports.uuid4 = function () {
//// return uuid of form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
var uuid = '', ii;
for (ii = 0; ii < 32; ii += 1) {
@shunchu
shunchu / video-thumbnails-generator.sh
Created November 15, 2012 18:00
Batch generate thumbnails from mp4 files using ffmpg
#!/bin/bash
# setup
FILES=name_of_file_to_match_*.mp4
SEEK_POINT=00:00:30
IMG_FORMAT=png
FRAME_SIZE=150X100
DEST=thumbnails
for f in $FILES
@brian-mann
brian-mann / FadeTransitionRegion.js
Created October 24, 2012 16:28
Allows jQuery animation transitions between marionette regions
var FadeTransitionRegion = Backbone.Marionette.Region.extend({
show: function(view){
this.ensureEl();
view.render();
this.close(function() {
if (this.currentView && this.currentView !== view) { return; }
this.currentView = view;