Skip to content

Instantly share code, notes, and snippets.

@jaan
jaan / Sublime Text Tips
Last active August 29, 2015 14:01
Sublime Text Tips
1. Opening sublime from command prompt:
a. In a command prompt(mac)
Run: sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /bin/subl
This will create a symlink, after this you can run below commands:
~ subl --> To open editor
~ subl . --> To open the current folder in Sublime
~ subl filename --> To open file in sublime
2. All about sublime (videos)
https://tutsplus.com/course/improve-workflow-in-sublime-text-2/
@jaan
jaan / Javascript resources
Created May 8, 2014 04:51
Javascript resources
Useful links to advanced javascript resources:
http://superherojs.com/
@jaan
jaan / gist:10192956
Created April 8, 2014 21:10
Disable the users javascript console
// It appears Netflix is following (Facebook's lead)[https://news.ycombinator.com/item?id=7222129].
(function() {
try {
var $_console$$ = console;
Object.defineProperty(window, "console", {
get: function() {
if ($_console$$._commandLineAPI)
throw "Sorry, for security reasons, the script console is deactivated on netflix.com";
return $_console$$
// Please, please, please don't try this at home
$(document).ready(function() {
$("a.meatloaf").on("click", function(e) {
// Once upon a time, there was a developer...
e.preventDefault(); // Prevent the default behavior
e.stopPropagation(); // Not working like expected, so stop it
e.stopImmediatePropagation(); // No really, stop it
return false; // Just in case... STOP IT!
// Moral of story: Know what each of the above statements mean
});
// Avoid `console` errors in browsers that lack a console.
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeStamp', 'trace', 'warn'
];
@jaan
jaan / gist:9266471
Created February 28, 2014 06:40
Frame buster
If you don't want other sites to frame your site in iframe
<iframe src="http://abcd.com"></iframe>
You can insert anti-framing, frame busting JavaScript into all your pages:
if (top != self) { top.location.replace(self.location.href); }
@jaan
jaan / Front-end visual regression testing tools
Last active December 26, 2015 00:39
Front-end visual regression testing tools
Wraith https://github.com/BBC-News/wraith
Huxley https://github.com/facebook/huxley
PhantomCSS https://github.com/Huddle/PhantomCSS
PhotoBox https://github.com/stefanjudis/grunt-photoBox