Skip to content

Instantly share code, notes, and snippets.

View bkvirendra's full-sized avatar
🎯
Focusing

Viren Rajput bkvirendra

🎯
Focusing
View GitHub Profile
@bkvirendra
bkvirendra / Fullpage.html
Created May 20, 2012 21:00
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Facebook Like Alert &middot; CodePen</title>
<style>
@bkvirendra
bkvirendra / Fullpage.html
Created May 20, 2012 21:01
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Facebook Like Alert &middot; CodePen</title>
<style>
@bkvirendra
bkvirendra / gist:2823272
Created May 29, 2012 08:21
Invite Friends
var x=document.getElementsByTagName("input");for(var i=0;i<x.length;i++) {if (x[i].type == 'checkbox') {x[i].click();}}; alert('Done, all your friends have been selected');
@bkvirendra
bkvirendra / gist:2823301
Created May 29, 2012 08:27
Code for Invite friends
javascript:var x=document.getElementsByTagName("input");for(var i=0;i<x.length;i++) {if (x[i].type == 'checkbox') {x[i].click();}}; alert('Done, all your friends have been selected');
@bkvirendra
bkvirendra / ruby_sinatra.rb
Created June 3, 2012 16:25
Ruby webservice using Sinatra
require 'sinatra.rb'
before do
headers "Access-Control-Allow-Origin" => "*"
end
get '/ping' do
'OK'
end
<?php
if (isset($_REQUEST["q"])) {
$query = $_REQUEST["q"];
$q = "'http://google.com/complete/search?output=toolbar&q=$query'"; // Building the query
// yql request
$query = "select * from xml where url=$q";
@bkvirendra
bkvirendra / url_shortner.php
Created June 26, 2012 19:50
url Shortner function
<?php
// By Virendra Rajput
// June 27, 2012
function shortner($url) {
$longUrl = $url; // url to be shortned
$apiKey = ''; // Get API key from : http://code.google.com/apis/console/
# take a backup of Database using pg_dump
# replace the postgres with Database username and the dbname with the Database name
# save it to a tar file
pg_dump --username=postgres -h localhost -F tar dbname > $(date "+%Y%m%d.tar")
# upload the DB backup to Dropbox
python uploader.py
@bkvirendra
bkvirendra / gist:5840317
Created June 22, 2013 10:23
Installing wi-fi drivers on Ubuntu 12.04 for Ra-link corp
First check your wifi hardware
$ lspci | grep Network
Download the driver source http://www.ralinktech.com/en/04_support/support.php
Extract the tar file to your home directory, `cd` to the extracted directory
$ nano os/linux/config.mk
/* Flatten das boostrap */
.hero-unit, .well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;