Skip to content

Instantly share code, notes, and snippets.

Avatar

Surendran surendrans

View GitHub Profile
@surendrans
surendrans / push.rb
Created Jan 20, 2012
Rhodes Push Notification
View push.rb
class PushController < Rho::RhoController
def receive_push
Alert.show_popup("You have a message")
end
end
@surendrans
surendrans / ruby_push_notification.rb
Created Jan 20, 2012
Push Notification to Android Devices Using speedy_c2dm Ruby Client
View ruby_push_notification.rb
require 'speedy_c2dm'
require "net/http"
require "net/https"
C2DM_API_EMAIL = "c2dm_registered@gmail.com"
C2DM_API_PASSWORD = "registered email password"
SOME_REGISTRATION_ID ="device_id_registered_to_receive_push_notification"
p "Setting the email and password"
SpeedyC2DM::API.set_account(C2DM_API_EMAIL, C2DM_API_PASSWORD)
options = {
:registration_id => SOME_REGISTRATION_ID,
@surendrans
surendrans / gist:3162337
Created Jul 23, 2012 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide
View gist:3162337

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@surendrans
surendrans / gist:3162338
Created Jul 23, 2012 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide
View gist:3162338

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

View gist:5064287

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

View parallel_fetch.rb
require 'typhoeus'
require "json"
url1 = "https://api.twitter.com/1/statuses/user_timeline.json?screen_name=dchelimsky&count=20"
url2 = "https://api.twitter.com/1/statuses/user_timeline.json?screen_name=spritlesoftware&count=5"
url3 = "https://api.twitter.com/1/statuses/user_timeline.json?screen_name=TouchVu&count=10"
url4 = "https://api.twitter.com/1/statuses/user_timeline.json?screen_name=ibmmobile&count=1"
hydra = Typhoeus::Hydra.new
View ssh-keys
download open ssl for windows: http://www.openssl.org/source/
Reference :
http://www.neilstuff.com/apache/apache2-ssl-windows.htm (for installation)
http://www.napcsweb.com/howto/rails/deployment/RailsWithApacheAndMongrel.pdf (for httpd.conf and ssl.conf & proxy fix)
Sample openssl confi (required to create key file)
View gist:1662733493f1c664d521

####What is GOlang ? Current Beta version Go 1.3 Beta 2 is released!

Compiled
Garbage collected 
Concurrent

Compiled

View gist:80d31f1a2765dea258a4
http://www.jsnice.org/
JSNice can be used for various purposes including:
Deminify obfuscated JavaScript code (most code on the Web is minified).
Suggest more appropriate identifier names for your non-obfuscated program.
Even propose likely types, automating the process of program annotation.
View gist:b1c5d00c63e1d0a0ce7d
angular.module('starter.services', [])
.factory('loading', ['$ionicLoading', function($ionicLoading){
return {
show: function() {
$ionicLoading.show({
template: '<i class="icon ion-loading-a"></i> loading...',
animation: 'fade-in',
showBackdrop: true,
maxWidth: 200,