Skip to content

Instantly share code, notes, and snippets.

View dhruvasagar's full-sized avatar

Dhruva Sagar dhruvasagar

View GitHub Profile
alert('test');
@dhruvasagar
dhruvasagar / WebRTC Outline.md
Created October 13, 2016 04:28
WebRTC Outline
  • Introduction to WebRTC
  • Why WebRTC ?
  • WebRTC underpinnings : Signaling, STUN, TURN
  • Open Source Libraries & Tools available
  • Building your own Signaling Server
  • Demo
# Why is this change necessary ?
# How does it address the issue ?
# What side effects does this change have ?
# References
nnoremap g> <ESC>vap:Twrite bottom-right<CR>
xnoremap g> :Twrite bottom-right<CR>
{
"customer_name": "Girish ",
"customer_phone_number": "8345657321",
"amount": 199,
"placement_date": "16/06/2016",
"line_items": [
{
"variant_sku": "TIWD2571_M",
"quantity": 1,
"lmdn_enabled": true,
#!/usr/bin/env ruby
def fizz(num)
num % 3 == 0 ? "Fizz" : nil
end
def buzz(num)
num % 5 == 0 ? "Buzz" : nil
end
#!/usr/bin/env ruby
require 'uri'
require 'json'
require 'net/http'
if ARGV.length > 0
query = ARGV[0]
else
print 'Input word: '
function Describe(title, testFunc, parent) {
this._title = title;
this._parent = parent;
this._testFunc = testFunc;
if ( ! this._parent ) { // root
this.run();
}
}
function! FoldAllBut( foldminlines )
folddoclosed
\ if ( (foldclosed(".") >= 0 ) && ( foldclosedend(".") - foldclosed(".") + 1 < a:foldminlines ))
\ exe "normal! zO"
\ endif
endfunction
@dhruvasagar
dhruvasagar / abilities.rb
Created September 17, 2012 07:58 — forked from ryanb/abilities.rb
How you can break up large Ability class in CanCan
module Abilities
def self.ability_for(user)
if user.admin?
AdminAbility.new(user)
else user
MemberAbility.new(user)
else
GuestAbility.new
end
end