Skip to content

Instantly share code, notes, and snippets.

View jprichardson's full-sized avatar

JP Richardson jprichardson

View GitHub Profile
@roldershaw
roldershaw / imsg
Last active March 1, 2022 19:34
Send iMessages from the command line using Bash and AppleScript
#!/bin/bash
if [ -z "$1" ] || [ -z "$2" ] ; then
echo "Usage: imsg [address] [message]"
else
/usr/bin/osascript -e 'tell application "Messages"
send "'"$2"'" to buddy "'"$1"'" of service "E:you@icloud.com"
end tell'
echo "Sent"
fi
@waldher
waldher / gist:5453375
Created April 24, 2013 16:13
nginx config for use with node and unix sockets
upstream app {
server unix:/home/user/application/tmp/socket fail_timeout=0;
}
server {
listen 80;
server_name example.com;
root /home/user/application/public;
@waldher
waldher / gist:5453355
Created April 24, 2013 16:09
NodeJS code for using UNIX sockets at 'tmp/socket' for production environments, and port 3000 for development.
var listenOn = 3000;
if(process.env.NODE_ENV == 'production'){
listenOn = "tmp/socket";
}
var startServer = function(){
app.listen(listenOn, undefined, undefined, function(){
console.log("Listening on " + listenOn);
if(typeof(listenOn) == 'string'){
fs.chmod(listenOn, 0777);
@Raynos
Raynos / redirect.md
Created March 1, 2012 00:33
Mongo collection utility
@lucasmazza
lucasmazza / script.md
Created August 17, 2011 17:49
Redis 2.2 Install on Ubuntu 10.04

Installation commands:

$ wget http://redis.googlecode.com/files/redis-2.2.2.tar.gz
$ tar xvfz redis-2.2.2.tar.gz 
$ cd redis-2.2.2/
$ mkdir -p /opt/redis
$ make PREFIX=/opt/redis install
$ cp redis.conf /opt/redis/redis.conf
$ chown -R redis:redis /opt/redis