Skip to content

Instantly share code, notes, and snippets.

View jjaffeux's full-sized avatar

Joffrey JAFFEUX jjaffeux

View GitHub Profile
@chsh
chsh / appapp_delegate.rb
Created May 10, 2012 08:41
RubyMotion Localization sample.
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
alert = UIAlertView.new
alert.message = t('start')
alert.show
true
end
def t(key)
NSBundle.mainBundle.localizedStringForKey(key, value:nil, table:nil)
class PostsController < ActionController::Base
def create
Post.create(post_params)
end
def update
Post.find(params[:id]).update_attributes!(post_params)
end
private
@brentkirby
brentkirby / stack.sh
Created January 31, 2012 22:18
Linode nginx, php, mysql stackscript
#!/bin/bash
#
# Ruby 1.9.2 with options for database, and nginx install. Adds option to install RVM system-wide.
# Outputs to /root/stackscript.log
#
# <UDF name="deploy_user" Label="Name of deployment user." />
# <UDF name="deploy_password" Label="Password for deployment user." />
# <UDF name="deploy_sshkey" Label="Deployment user public ssh key." />
# <UDF name="ssh_port" Label="SSH Port" />
# <UDF name="new_hostname" Label="Server's hostname." />
@mranney
mranney / emoji_sad.txt
Created January 30, 2012 23:05
Why we can't process Emoji anymore
From: Chris DeSalvo <[email protected]>
Subject: Why we can't process Emoji anymore
Date: Thu, 12 Jan 2012 18:49:20 -0800
Message-Id: <[email protected]>
--Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
@csanz
csanz / movingredistolinode.md
Created August 29, 2011 07:40
Moving your redis instance to linode

Move your redis instance to Linode!

create linode server instance

local:

<shell>$ssh root@(IP ADDRESS)

remote:

@mikeyk
mikeyk / redis_session_backend.py
Created April 8, 2011 18:01
A redis backend for Django Sessions, tested on Django 1.3+
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(