Skip to content

Instantly share code, notes, and snippets.

View arun057's full-sized avatar

Arunram Kalaiselvan arun057

  • PlaceIQ
  • New York, NY
View GitHub Profile
@arun057
arun057 / Browser Detection + Apply Classes to HTML Element CSS-Tricks.js
Created October 13, 2011 20:29
Browser Detection + Apply Classes to HTML Element | CSS-Tricks
// jQBrowser v0.2: http://davecardwell.co.uk/javascript/jquery/plugins/jquery-browserdetect/
//weird characters should be included.
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(c/a))+String.fromCharCode(c%a+161)};while(c--){if(k[c]){p=p.replace(new RegExp(e(c),'g'),k[c])}}return p}('Ö ¡(){® Ø={\'¥\':¡(){¢ £.¥},\'©\':{\'±\':¡(){¢ £.©.±},\'¯\':¡(){¢ £.©.¯}},\'¬\':¡(){¢ £.¬},\'¶\':¡(){¢ £.¶},\'º\':¡(){¢ £.º},\'Á\':¡(){¢ £.Á},\'À\':¡(){¢ £.À},\'½\':¡(){¢ £.½},\'¾\':¡(){¢ £.¾},\'¼\':¡(){¢ £.¼},\'·\':¡(){¢ £.·},\'Â\':¡(){¢ £.Â},\'³\':¡(){¢ £.³},\'Ä\':¡(){¢ £.Ä},\'Ã\':¡(){¢ £.Ã},\'Å\':¡(){¢ £.Å},\'¸\':¡(){¢ £.¸}};$.¥=Ø;® £={\'¥\':\'¿\',\'©\':{\'±\':²,\'¯\':\'¿\'},\'¬\':\'¿\',\'¶\':§,\'º\':§,\'Á\':§,\'À\':§,\'½\':§,\'¾\':§,\'¼\':§,\'·\':§,\'Â\':§,\'³\':§,\'Ä\':§,\'Ã\':§,\'Å\':§,\'¸\':§};Î(® i=0,«=».ì,°=».í,¦=[{\'¤\':\'Ý\',\'¥\':¡(){¢/Ù/.¨(°)}},{\'¤\':\'Ú\',\'¥\':¡(){¢ Û.³!=²}},{\'¤\':\'È\',\'¥\':¡(){¢/È/.¨(°)}},{\'¤\':\'Ü\',\'¥\':¡(){¢/Þ/.¨(°)}},{\'ª\':\'¶\',\'¤\':\'ß Ñ\',\'
@arun057
arun057 / word-break.css
Created March 16, 2012 13:35
CSS Word break and Hyphenate
-ms-word-break: break-all;
word-break: break-all;
// Non standard for webkit
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
@arun057
arun057 / gist:5556563
Created May 10, 2013 18:53
mysqldump: Couldn’t execute ‘SELECT @@GTID_MODE’: Unknown system variable ‘GTID_MODE’ (1193)
# If you are using the MySQL 5.6 version of mysqldump on an older MySQL database, you might get the error message.
mysqldump: Couldn't execute 'SELECT @@GTID_MODE': Unknown system variable 'GTID_MODE' (1193)
# This error is in part due to the introduction of Global Transaction Identifiers (GTIDs) in MySQL 5.6. GTIDs make it simple to # track and compare replication across a master-slave topology.
# mysqldump tries to query this system variable, which doesn’t exist in earlier versions, and then fails. The solution is to add # –set-gtid-purged=OFF in the mysqldump command. It should look something like
mysqldump -h dbHost -u dbuser dbName --set-gtid-purged=OFF
@arun057
arun057 / gist:5579081
Created May 14, 2013 20:10
Enable mySQL global logging.
SET GLOBAL general_log = 'ON';
// Additonally , to see where all your log files are located,
SELECT * FROM information_schema.GLOBAL_VARIABLES where VARIABLE_NAME like '%log%';
@arun057
arun057 / gist:5687665
Last active December 17, 2015 23:09
git aliases for some really nice stuff
#http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/
git config --global alias.assume 'update-index --assume-unchanged'
git config --global alias.unassume 'update-index --no-assume-unchanged'
git config --global alias.assumed '!git ls-files -v | grep ^h | cut -c 3-'
git config --global alias.snapshot '!git stash save "snapshot: $(date)" && git stash apply "stash@{0}"'
# please only interesting methods!
class Object
# return only the methods not present on basic objects
def interesting_methods
(self.methods - Object.new.methods).sort
end
end
@arun057
arun057 / gist:350379696b0a03774167
Created September 20, 2014 18:21
Maven colorize bash
# In your ~/.bash_profile
# Formatting constants
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@arun057
arun057 / loadoing_screen.as
Created December 10, 2014 20:49
Fancy Loading screen
// https://www.reddit.com/r/gifs/comments/2on8si/connecting_to_server_so_mesmerizing/cmow0sz
private const NUM_BALL:int = 24;
private var loadingBall:Vector.<Shape> = new Vector.<Shape>(NUM_BALL);
private var timeStep:int = 0;
private const BALL_HEIGHT:int = 40;
public function animateBalls(e:Event):void
{
for (var i:int = 0; i < NUM_BALL; i++ )
@arun057
arun057 / heatmap.js
Created January 10, 2015 19:28
scripted
// You will perform all your work in this file.
// Paste your API key here
var api_key = "54af01f3afe4e";
/************** TASK 1 **************/
//
// This function should get the whole set of complaint data from the server and then
// update the heatmap with it.
//