Skip to content

Instantly share code, notes, and snippets.

Tushar Sonawane Tushkiz

Block or report user

Report or block Tushkiz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View chargingStation.html
<!DOCTYPE html>
<html>
<head>
<title>Nearest Chariging Station</title>
<style>
#map {
height: 500px;
width: 100%;
}
View osx_setup.md

Setup Mac OS X Mountain Lion or Mavericks

Edit: I few months ago I got a new laptop and did the same thing on Mavericks.

I just replaced the hard drive of my mbp and decided to do a clean install of Mountain Lion (10.8.5) since I was still using Snow Leopard (10.6.8).

I kinda regret for not using Boxen to automate the

View protect.md

##Instructions to protect your services?

  1. Check whether your website, apps or any products use OpenSSL and whether they are vulnerable to the attack. There is a neat site at http://filippo.io/Heartbleed/ where you can quickly run the check.
  2. Update OpenSSL to the latest version which fixes the defect – this is not an automatic process in many cases. See the advisory here.
  3. Check the state of the your SSL configuration for your website and mail services. You can use this SSL checker and CheckTLS for mail servers. This bug is the least of your worries if you are using the technology badly in the first place.
  4. Take a look at the more technical Q&A at http://heartbleed.com/ if you have further questions about the bug or how to remediate it.
View List.js
function List() {
this.head = this.tail = null
}
List.prototype.add = function add(node) {
if (this.head) {
node.next = this.head;
this.head.prev = node;
}
this.head = node;
View gist:7541601
# ~/.gitconfig from @boblet
# initially based on http://rails.wincent.com/wiki/Git_quickstart
[core]
excludesfile = /Users/oli/.gitignore
legacyheaders = false # >git 1.5
quotepath = false
# http://stackoverflow.com/questions/136178/git-diff-handling-long-lines
pager = less -r
# if ↑ doesn’t work, try: pager = less -+$LESS -FRX
View sublime_text_2_useful_shortcuts.md

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@Tushkiz
Tushkiz / randomNumber.js
Created May 7, 2013
Random Number Function
View randomNumber.js
function randomNumber(from, to) {
return Math.floor((Math.random()*(to - from + 1)) + from);
}
@Tushkiz
Tushkiz / RegEx.js
Last active Dec 17, 2015
Common Regular Expressions
View RegEx.js
// Common Regular Expression
// Email Address
/* Humans */ var emailHuman = /[-\w.]+@([A-z0-9][-A-z0-9]+\.)+[A-z]{2,4}/i;
/* Bots */ var emailBots = /^[\w!#$%&\’*+\/=?^`{|}~.-]+@(?:[a-z\d][a-z\d-]*(?:\.[a-z\d][a-z\d-]*)?)+\.(?:[a-z][a-z\d-]+)$/i;
// Date
var datePattern = /([01]?\d)[-\/ .]([0123]?\d)[-\/ .](\d{4})/;
// Web Address
View console.log.js
var debug = true,
_log = function() {
debug && window.console && console.log.apply(console, arguments);
};
@Tushkiz
Tushkiz / memoizer.js
Last active Dec 15, 2015
Faster Recursions The memoizer function will take an initial 'cache' array and the 'operation' function. It returns a 'self' function that manages the cache store, this 'self' function calls the 'operation' function only when there is a 'cache' miss, ultimately improves performance.
View memoizer.js
var memoizer = function (cache, operation) {
var self = function (n) {
var result = cache[n];
if (typeof result !== 'number') {
result = operation(self, n);
cache[n] = result;
}
return result;
};
return self;
You can’t perform that action at this time.