Skip to content

Instantly share code, notes, and snippets.

View surendrans's full-sized avatar

Surendran surendrans

View GitHub Profile
@surendrans
surendrans / push.rb
Created January 20, 2012 09:08
Rhodes Push Notification
class PushController < Rho::RhoController
def receive_push
Alert.show_popup("You have a message")
end
end
@surendrans
surendrans / ruby_push_notification.rb
Created January 20, 2012 09:10
Push Notification to Android Devices Using speedy_c2dm Ruby Client
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 July 23, 2012 06:55 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide

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 July 23, 2012 06:56 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide

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".

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".

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
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)
@surendrans
surendrans / gist:1662733493f1c664d521
Last active August 29, 2015 14:01
GOLang Introduction

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

Compiled
Garbage collected 
Concurrent

Compiled

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.
@surendrans
surendrans / gist:b1c5d00c63e1d0a0ce7d
Last active August 29, 2015 14:07
ionicLoading.js
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,