Skip to content

Instantly share code, notes, and snippets.

@atishgoswami
atishgoswami / chrome.txt
Created October 19, 2013 21:13
Install Chrome For Ubuntu 12.04 (Solved)
wget https://dl.dropboxusercontent.com/u/85403877/ubu13-chrome-fix/lib32gcc1_4.7.3-1ubuntu1_all.deb
wget https://dl.dropboxusercontent.com/u/85403877/ubu13-chrome-fix/lib32stdc%2B%2B6_4.7.3-1ubuntu1_all.deb
wget https://dl.dropboxusercontent.com/u/85403877/ubu13-chrome-fix/libc6-i386_2.17-0ubuntu5_all.deb
sudo dpkg -i lib32gcc1_4.7.3-1ubuntu1_all.deb lib32stdc++6_4.7.3-1ubuntu1_all.deb libc6-i386_2.17-0ubuntu5_all.deb
sudo dpkg -i google-chrome-stable_current_i386.deb
sudo apt-get -f install
@atishgoswami
atishgoswami / selection.js
Created October 7, 2013 12:42
javascript Select Text on click
function SelectText(element) {
var doc = document
, text = doc.getElementById(element)
, range, selection
;
if (doc.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText(text);
range.select();
} else if (window.getSelection) {
@atishgoswami
atishgoswami / laravel.txt
Last active October 26, 2016 23:46
Laravel Snipps
http://cheats.jesse-obrien.ca/
https://gist.github.com/anchetaWern/4223764
https://medium.com/on-coding/e8d93c9ce0e2
http://laravelbook.com/laravel-user-authentication/
https://github.com/formativ/tutorial-laravel-4-authentication
@atishgoswami
atishgoswami / git.sh
Created August 22, 2013 12:56
Git Delete Commit
git reset --soft HEAD~1 //delete previous commit
HEAD~1 is a shorthand for the commit before head. Alternatively you can refer to the SHA-1 of the hash you want to reset to. --soft option will delete the commit but it will leave all your changed files "Changes to be committed", as git status would put it.
If you want to get rid of any changes to tracked files in the working tree since the commit before head use --hard instead.
Now if you already pushed and someone pulled which is usually my case, you can't use git reset. You can however do a git revert,
git revert HEAD
This will create a new commit that reverses everything introduced by the accidental commit.
@atishgoswami
atishgoswami / gist.js
Created August 21, 2013 18:18
Its a file for console log
var a = map.getDiv(),
b = a.offsetLeft,
c = a.offsetTop,
e = a.offsetWidth,
h = a.offsetHeight;
var f = drag_area.offsetLeft,
i = drag_area.offsetTop,
g = obj.offsetWidth,
p = obj.offsetHeight;
var j = obj.offsetLeft + f + g / 2;
@atishgoswami
atishgoswami / css.js
Created August 13, 2013 10:59
Get css of elements
function css(a){
var o = {};
var rules = window.getMatchedCSSRules(a.get(0));
for(var r in rules) {
o = $.extend(o, css2json(rules[r].style), css2json(a.attr('style')));
}
return o;
}
function css2json(css){
var s = {};
@atishgoswami
atishgoswami / camelcase.php
Created August 13, 2013 04:04
Camel Case Strings
<?php
if ( ! function_exists('camelCase'))
{
function camelCase($subject, $delimiters=' _-', $lcfirst=true)
{
if ( ! is_string($subject))
{
throw new Exception("Subject must be of type string");
}
@atishgoswami
atishgoswami / ubuntu.sh
Created July 3, 2013 09:58
Apache setup Userdir
//run command
sudo a2enmod userdir
//open file
sudo nano /etc/apache2/mods-available/php5.conf
//change
<IfModule mod_userdir.c>
@atishgoswami
atishgoswami / concat.js
Last active December 18, 2015 19:09
Fix sahi to work with firefox 21
//Open sahi/htdocs/spr/concat.js
//and look for:
Sahi.prototype._isFF2 = function () {return /Firefox\/2|Iceweasel\/2|Shiretoko\/2/.test(this.navigator.userAgent);};
Sahi.prototype._isFF3 = function () {return /Firefox\/3|Iceweasel\/3|Shiretoko\/3/.test(this.navigator.userAgent);};
Sahi.prototype._isFF4 = function () {return /Firefox\/4|Iceweasel\/4|Shiretoko\/4/.test(this.navigator.userAgent);};
Sahi.prototype._isFF5 = function () {return /Firefox\/5|Iceweasel\/5|Shiretoko\/5/.test(this.navigator.userAgent);};
//and replace it with
@atishgoswami
atishgoswami / git.sh
Last active December 18, 2015 16:29
Git Export Diff files Between two commits
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT HEAD~1 HEAD | xargs tar -rf ~/exports/export.tar