Skip to content

Instantly share code, notes, and snippets.

Avatar

Sam Seltzer-Johnston sbseltzer

View GitHub Profile
View runspacemacs.sh
#!/bin/bash
# To install:
# Save as runspacemacs and make sure it's in your PATH (I keep mine in ~/bin)
# Run chmod u+x runspacemacs
new_frame=""
if [ "$1" == "" ]; then
new_frame="-c"
fi
emacsclientw $new_frame -a "" $@ &
@sbseltzer
sbseltzer / 1_ubuntu_terminal_command
Last active Jul 30, 2018 — forked from lucasdavila/1_ubuntu_terminal_command
Installing Source Code Pro fonts in ubuntu
View 1_ubuntu_terminal_command
# to execute this gist, run the line bellow in terminal
\curl -L https://gist.githubusercontent.com/seltzy/2e9c791bf8f57a388cfffc4dd92824db/raw/1c100cae16a06bef154af0f290d665405b554b3b/install_source_code_pro.sh | sh
@sbseltzer
sbseltzer / Makefile
Last active Mar 23, 2017
Root Makefile for use with Orx
View Makefile
# Requires MSBuild.exe and CL.exe for your respective Visual Studio version to be in your System Environment Path variable.
ifeq ($(OS),Windows_NT)
VS_VERSION = vs2013
endif
# Tutorials
tsbuild:
ifeq ($(OS),Windows_NT)
tutorial/build/premake4 --file=tutorial/build/premake4.lua $(VS_VERSION)
else
@sbseltzer
sbseltzer / timestamp.js
Created Oct 31, 2016 — forked from hurjas/timestamp.js
Print out a nicely formatted timestamp in JavaScript.
View timestamp.js
/**
* Return a timestamp with the format "m/d/yy h:MM:ss TT"
* @type {Date}
*/
function timeStamp() {
// Create a date object with the current time
var now = new Date();
// Create an array with the current month, day and time
@sbseltzer
sbseltzer / .gitignore
Last active Aug 30, 2015 — forked from thebeardphantom/.gitignore
Unity GitIgnore
View .gitignore
# Ignore everything
/*
/*/
# Inverse ignore some stuff
!/Assets/
!/ProjectSettings/
!.gitignore
# OS Stuff
@sbseltzer
sbseltzer / swizzle.lua
Created Feb 14, 2015
A simple function that adds configurable swizzling to any metatable.
View swizzle.lua
--[[
MakeSwizzle
Add swizzling functionality to a metatable!
@param MOriginal - Original metatable to add swizzling to.
@param keys - Ordered array of key names we want to swizzle on.
@param components - Ordered array of characters to associate with the key names from the keys array.
@param defaults - Optional list of default values to be used when t[GetComponent(c)] == nil.
@param constructor - When swizzling on valid keys, a list of associated values preceded by the custom swizzle metatable is passed to the constructor (in keys) from the __index metamethod, that is, constructor(MSwizzle, ...). The result of this function is returned by the __index metamethod.
@return MOriginal - The original metatable (which has been modified).
@return GetKey(i) - A function that returns the key name at index i from the keys parameter.
View tumblr_rwu_test.php
<?php
header( "Content-Type: text/plain" );
echo "Welcome to the test!\n";
include "TumblrReader.php";
include "TumblrWriter.php";
include "TumblrUser.php";
$consumer_key = 'your_consumer_key';
$consumer_secret = 'your_secret_key';