Skip to content

Instantly share code, notes, and snippets.

View joewright's full-sized avatar
🕶️
🤳 🌭

Joe Wright joewright

🕶️
🤳 🌭
View GitHub Profile
@marshall
marshall / activity1.js
Created February 22, 2011 17:24
Native Titanium + Android example code
var activity = Ti.Android.currentActivity;
var win = Ti.UI.currentWindow;
activity.addEventListener("create", function(e) {
var button = Ti.UI.createButton({title: "Hello world"});
button.addEventListener("click", function(e) {
activity.finish();
});
win.add(button);
});
@saetia
saetia / gist:1623487
Last active April 20, 2025 23:05
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@aemkei
aemkei / LICENSE.txt
Last active March 7, 2025 20:08 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@charlesdaniel
charlesdaniel / basic_auth_nodejs_test.js
Created January 27, 2012 02:53
Example of HTTP Basic Auth in NodeJS
var http = require('http');
var server = http.createServer(function(req, res) {
// console.log(req); // debug dump the request
// If they pass in a basic auth credential it'll be in a header called "Authorization" (note NodeJS lowercases the names of headers in its request object)
var auth = req.headers['authorization']; // auth is in base64(username:password) so we need to decode the base64
console.log("Authorization Header is: ", auth);
@pixelite
pixelite / Vagrant-sphinx-pdflatex.md
Last active March 14, 2018 15:11
Creating a Vagrant vm with sphinx and pdflatex

First create a Vagrantfile:

vagrant init precise64

Then add the following to the new Vagrantfile:

config.vm.provision :shell, :inline => <<-EOT
@BlakeGardner
BlakeGardner / install nano.sh
Last active May 5, 2025 17:15
Syntax highlighting in nano on Mac OS
# Last updated May, 2024 for Apple silicon Macs
# Install Homebrew if you don't already have it: https://brew.sh
# install nano from homebrew
brew install nano nanorc
# update your nanorc file
echo 'include "'"$(brew --cellar nano)"'/*/share/nano/*.nanorc"' >> ~/.nanorc
# close and re-open your terminal and you'll have syntax highlighting
@willurd
willurd / web-servers.md
Last active May 10, 2025 14:01
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jonathanmorley
jonathanmorley / regex_golf.md
Last active March 1, 2025 13:14 — forked from jpsim/answers.md
Best possible answers collected so far for [Regex golf](http://regex.alf.nu/). === WARNING: SPOILERS ===
@jeremyfelt
jeremyfelt / open-source-search-compare.md
Last active January 3, 2025 13:33
Comparing open source search solutions
@tegansnyder
tegansnyder / solr-extension-php-rhel.sh
Created January 29, 2014 16:11
Steps to install the SOLR PHP extension on RHEL. Installation is a little trickery because of how curl is built into PHP as a shared library and not statically compiled.
# install dependencies
sudo yum install curl-devel
sudo yum install libxml2-devel
# install extension for solr -- note use pear instead of pecl install
sudo pear install pecl/solr
# when it asks for libcURL path if you are on a 64bit machine
# change:
libcURL install prefix [/usr] : /usr/lib64