Skip to content

Instantly share code, notes, and snippets.

View tusharvikky's full-sized avatar
💭
contemplating...

Tushar Deo tusharvikky

💭
contemplating...
View GitHub Profile
@tusharvikky
tusharvikky / mtnl3g.md
Last active December 21, 2015 01:48
Taming the MTNL "Jadoo" 3G USB dongle

Install and test usb-modeswitch

usb_modeswitch -v 230d -p 0103 -u 2

Edit /lib/udev/rules.d/40-usb_modeswitch.rules

@tusharvikky
tusharvikky / gist:6220918
Created August 13, 2013 13:10
apache2 - enabling and disabling sites
# enable site
sudo a2ensite
# disable site
sudo a2dissite
# enable an apache2 module
sudo a2enmod
# e.g. a2enmod php4 will create the correct symlinks in mods-enabled to allow the module to be used. In this example it will link both php4.conf and php4.load for the user
@tusharvikky
tusharvikky / luna.md
Created August 12, 2013 10:54 — forked from jensk/luna.md
# Initial setup
git clone -o framework -b develop https://github.com/laravel/laravel.git project-name
cd project-name
git checkout --orphan master
git commit -m "Initial commit"
# Pulling changes
git fetch framework
git merge --squash -m "Upgrade Laravel" framework/develop
# Fix merge conflicts if any and commit
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Dynamic Gist Embedding</title>
</head>
<body>
<p>
<?php
/**
* Ranking Library
* contains alogrithms for story ranking
* Basically a PHP Implementation of reddits algorithms
*
* @author Lucas Nolte <[email protected]>
* @since 0.1
* @package Polska Wiadomosc
* @subpackage Libraries
@tusharvikky
tusharvikky / select_var.html
Last active December 11, 2015 04:38
Friend Requests: This gist will fetch the value of the select and will log it in console.
<!-- Author: @tusharvikky -->
<!-- Created: 16th Jan 2013 -->
<html>
<head>
<title>Grab select value</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#button").click(function(e){
e.preventDefault(); // This is just to prevent re submitting of form again as default jquery.
@tusharvikky
tusharvikky / gist:4527478
Created January 14, 2013 03:00
Gist to reboot Linksys Router with just a single click. [BookMark it]
192.168.1.1/setup.cgi?todo=reboot
@tusharvikky
tusharvikky / snippet.xml
Created October 21, 2012 15:01 — forked from JeffreyWay/snippet.xml
Laravel Resource - Sublime Text 2 Snippet
<snippet>
<content><![CDATA[
// ${1} Resource
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index'));
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show'));
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new'));
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit'));
Route::post('${1}s', '${1}s@create');
Route::put('${1}s/(:any)', '${1}s@update');
Route::delete('${1}s/(:any)', '${1}s@destroy');
@tusharvikky
tusharvikky / CI_Date.php
Created September 14, 2012 19:07 — forked from kylefarris/CI_Date.php
Codeigniter Date Library
<?php
class CI_Date {
public $sec_in_min, $min_in_hour, $hr_in_day, $day_in_wk, $sec_in_wk, $sec_in_day, $min_in_wk, $min_in_day, $hr_in_wk;
public function __construct() {
$this->sec_in_min = 60;
$this->min_in_hr = 60;
$this->hr_in_day = 24;
$this->day_in_wk = 7;
$this->day_in_yr = 365;
$this->sec_in_hr = $this->sec_in_min * $this->min_in_hr;