Skip to content

Instantly share code, notes, and snippets.

View thapakazi's full-sized avatar
💭
🐧 🗡️ 💻

Milan Thapa thapakazi

💭
🐧 🗡️ 💻
View GitHub Profile
he hey I am gonna change this gist 5868085 now.
@thapakazi
thapakazi / maya
Created June 26, 2013 15:22 — forked from rhoit/maya
# असारको माया
यो माया भन्‍ने चिज कस्तो
गर्मीमा घाम नलागेको जस्तो
लोडसेडीगमा tube-lite बाल्या जस्तो॥
यतिमात्र होईन, कि कसो,
गाईको दुध पनि कस्तो सस्तो
ncell को sim-card लिए जस्तो
we don't know where we will gonna be,
we don't know what it is goona next,
but one thing we are sure that,
we should dig, keep digging,
here,there, everywhere...
with hope that we could have one matced ryme
hey I just made a line
#gist :D
###Gist
-- a gem to upload snippets to https://gist.github.com
###How to install first ??
if ruby is installed then `gem install gist`
if you're using bundler then `source :rubygems gem gist`
###How to use it ?
@thapakazi
thapakazi / Awesome Links
Created July 2, 2013 04:32
Centralizing of Logging
@thapakazi
thapakazi / Virtualisation
Created July 3, 2013 06:38
Virtualisation Cookings with kvm,
#installation of Ubuntu 12.04,virtual Machine with KVM
virt-install -n ubuntu002 -r 2048 --vcpus=2 --os-type=linux --os-variant=ubuntuprecise --disk /var/lib/libvirt/images/ubuntu2_boot.img,device=disk,bus=virtio,size=20,sparse=true,format=raw -w bridge=br0,model=virtio --vnc --noautoconsole --location /var/lib/libvirt/images/ubuntu-12.04-server-amd64.iso --extra-args='console=tty0 console=ttyS0,115200n8 serial'
#!/usr/bin/env ruby
require 'csv'
# This assumes:
# - Ruby 1.9's CSV library, if you are using 1.8, use FasterCSV.
#
# https://raw.github.com/hadley/data-baby-names/master/baby-names.csv
csv_fname = "baby-names.csv"
@thapakazi
thapakazi / gist:6426932
Created September 3, 2013 17:29
OAuth , O mean opensOurce and Auth means ~orization
http://wiki.developerforce.com/page/Using_OAuth_to_Authorize_External_Applications
http://support.google.com/a/bin/answer.py?hl=en&answer=61017
http://oauth.net/
All these define OAuth as an opensource protocal to allow secure authorization in a simple and standard method from web, mobile, desktop apps. Eg:
*The OAuth documentation uses the analogy of a valet key to explain key concepts. When you park your car with a valet, you don't give him your regular key. You give him a special valet key that restricts his access to certain things like the trunk, glove box, etc. The rationale behind OAuth is the same. You give the consumer application limited access to resources in the service provider that you define.*
<?php defined('MOODLE_INTERNAL') || die();
$configuration = array (
'siteidentifier' => NULL,
'stores' =>
array (
'default_application' =>
array (
'name' => 'default_application',
'plugin' => 'file',
'configuration' =>
Omniauth Facebook Error - Faraday::Error::ConnectionFailed
Faraday::Error::ConnectionFailed
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, '<key from fb>', '<another key from fb>'
end
class SessionsController < ApplicationController
def create