Skip to content

Instantly share code, notes, and snippets.

View aliirz's full-sized avatar
🦄
People over Processes

Ali Raza aliirz

🦄
People over Processes
View GitHub Profile
@aliirz
aliirz / UICheckBox.h
Created August 24, 2011 12:10
A Checkbox Control for iOS
#import <Foundation/Foundation.h>
@interface UICheckBox : UIButton {
BOOL checked;
}
@aliirz
aliirz / README.md
Created December 7, 2011 14:37 — forked from napcs/README.md
Deploying Rails to Linode

Deploying Rails to Linode

Installing Ruby Enterprise Edition, Apache, MySQL, and Passenger for deploying Rails 3.0 applications.

Get a Linode, and set it up with Ubuntu 10.04 LTS so that you have till April 2013 to get updates. Once the Linode is formatted, boot it and continue on.

Set up an 'A' record in your DNS, pointing to the IP of your Linode. I'm using demo.napcs.com here.

Initial setup

@aliirz
aliirz / app.yaml
Created March 6, 2012 08:33
app.yaml for CDN
application: aliirzdotcom
version: 1
runtime: python
api_version: 1
handlers:
- url: /images
static_dir: images
- url: /css
static_dir: css
- url: /js
@aliirz
aliirz / .gitignore
Created May 13, 2012 14:54
.gitignore for .net projects
[Oo]bj
[Bb]in
*.user
*.suo
*.[Cc]ache
*.bak
*.ncb
*.log
*.DS_Store
[Tt]humbs.db
@aliirz
aliirz / twitter.m
Created May 23, 2012 11:04 — forked from vhbit/twitter.m
Follow us on Twitter button for iOS
- (BOOL)openTwitterClientForUserName:(NSString*)userName {
NSArray *urls = [NSArray arrayWithObjects:
@"twitter:@{username}", // Twitter
@"tweetbot:///user_profile/{username}", // TweetBot
@"echofon:///user_timeline?{username}", // Echofon
@"twit:///user?screen_name={username}", // Twittelator Pro
@"x-seesmic://twitter_profile?twitter_screen_name={username}", // Seesmic
@"x-birdfeed://user?screen_name={username}", // Birdfeed
@"tweetings:///user?screen_name={username}", // Tweetings
@"simplytweet:?link=http://twitter.com/{username}", // SimplyTweet
def login
c = Curl::Easy.new("https://test.tag-a-bag.com/api/secure/login?email="+params[:email]+"&password="+params[:password])
c.ssl_verify_host = false
c.perform
puts c.body_str
render :json => c.body_str
end
@aliirz
aliirz / toast.js
Last active December 11, 2015 03:18 — forked from kamranzafar/toast.js
var toast=function(heading, msg){
$("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h3>"+heading+"</h3><p>"+msg+"</p></div>")
.css({ display: "block",
opacity: 0.90,
position: "fixed",
padding: "7px",
"text-align": "center",
width: "270px",
left: ($(window).width() - 284)/2,
top: $(window).height()/2 })
"\n<html><head>\n<meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n<title>500 Server Error</title>\n</head>\n<body text=#000000 bgcolor=#ffffff>\n<h1>Error: Server Error</h1>\n<h2>The server encountered an error and could not complete your request.<p>If the problem persists, please <A HREF=\"http://code.google.com/appengine/community.html\">report</A> your problem and mention this error message and the query that caused it.</h2>\n<h2></h2>\n</body></html>\n"
root = "/home/deployer/apps/<appname>/current"
working_directory root
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.log"
stdout_path "#{root}/log/unicorn.log"
listen "/tmp/unicorn.blog.sock"
worker_processes 2
timeout 30
@aliirz
aliirz / unicorn_init
Created July 28, 2013 15:25
unicorn_init.sh for websites
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage unicorn server
# Description: Start, stop, restart unicorn server for a specific application.
### END INIT INFO