Skip to content

Instantly share code, notes, and snippets.

View mrchief's full-sized avatar
🎯
Focusing

Hrusikesh Panda mrchief

🎯
Focusing
View GitHub Profile
@chicagoworks
chicagoworks / jQuery.stringify.js
Created December 24, 2010 19:05
jQuery.stringify() utility
/**
* converted stringify() to jQuery plugin.
* serializes a simple object to a JSON formatted string.
* Note: stringify() is different from jQuery.serialize() which URLEncodes form elements
* UPDATES:
* Added a fix to skip over Object.prototype members added by the prototype.js library
* USAGE:
* jQuery.ajax({
@JamieHouston
JamieHouston / .git_ignore
Created December 22, 2011 05:29
git global ignore file for visual studio/windows
#OS junk files
[Tt]humbs.db
*.DS_Store
#Visual Studio files
*.[Oo]bj
*.user
*.aps
*.pch
*.vspscc
@narenranjit
narenranjit / VelToJSON
Created January 24, 2012 20:23
Convert objects in Velocity templates to JSON
#macro(VelListToJSON $list )
#set($myList = $list )## dereference
{
#foreach($key in $myList.keySet())
"$key":
#set($x = $myList.get($key))
#VelToJSON($x)
#if($foreachCount != $myList.keySet().size()) , #end
#end
}
@theburningmonk
theburningmonk / DictToExpando.cs
Created March 28, 2012 00:02
Dictionary to Expando
/// <summary>
/// Extension method that turns a dictionary of string and object to an ExpandoObject
/// </summary>
public static ExpandoObject ToExpando(this IDictionary<string, object> dictionary)
{
var expando = new ExpandoObject();
var expandoDic = (IDictionary<string, object>)expando;
// go through the items in the dictionary and copy over the key value pairs)
foreach (var kvp in dictionary)
@nemtsov
nemtsov / beautifier.js
Created June 3, 2012 17:24
JS Beautifier with the comma-first style (by Esailija)
/*jslint onevar: false, plusplus: false */
/*
JS Beautifier
---------------
Written by Einar Lielmanis, <einar@jsbeautifier.org>
http://jsbeautifier.org/
(function () {
var apply = Function.prototype.apply;
var flatten = apply.bind(Array.prototype.concat, []);
Array.prototype.selectMany = function (fn) {
return flatten(this.map(fn));
};
}());
// usage
@justincarroll
justincarroll / bootstrap-basic-template.htm
Last active May 11, 2018 04:43
This is my personal Bootstrap 3 and Font Awesome 4 basic HTML template.
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Basic Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
<link rel="stylesheet" href="style.css">
@vertexclique
vertexclique / cracking.md
Last active April 8, 2024 18:24
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

@Kartones
Kartones / postgres-cheatsheet.md
Last active May 7, 2024 17:48
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@TravelingTechGuy
TravelingTechGuy / bypass-should-eslint-error.js
Created June 12, 2015 15:33
Bypass ESLint no-unused-vars error for Should in a Mocha test
// Without line 9 hack, linting the file throws: 5:4 error should is defined but never used no-unused-vars
'use strict';
var debug = require('debug')('test:myModel');
var should = require('should');
var security = require('../models/myModel');
before((done) => {
should; //bypass ESLint no-unused-var error
done();