Skip to content

Instantly share code, notes, and snippets.

View tamer1an's full-sized avatar
🐋 Docking

Andrii Trybynenko tamer1an

🐋 Docking
View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active April 14, 2025 11:07
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@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({
@ariya
ariya / log.txt
Created February 14, 2012 03:21
jQuery Mobile startup log
jquery.js 17 [Anonymous] [object DOMWindow]
jquery.js 23 [Anonymous]
jquery.js 327 jQuery.fn.extend [object Object]
jquery.js 631 each Boolean,Number,String,Function,Array,Date,RegExp,Object, (Function)
jquery.js 495 isFunction Boolean,Number,String,Function,Array,Date,RegExp,Object
jquery.js 512 type Boolean,Number,String,Function,Array,Date,RegExp,Object
jquery.js 896 [Anonymous] 0, "Boolean"
jquery.js 896 [Anonymous] 1, "Number"
jquery.js 896 [Anonymous] 2, "String"
jquery.js 896 [Anonymous] 3, "Function"
@axemclion
axemclion / IndexedDB.setVersionShim.js
Created May 11, 2012 00:29
Shim that converts Chrome's SetVersion to the standard IndexedDB onupgradeneeded events
////////////////////////////////////////////////////////////////////////////////////////////////////
var openReqShim = function(dbName, version){
var me = this;
var IDBRequest = function(){
this.onsuccess = this.onerror = this.onblocked = this.onupgradeneeded = null;
};
function copyReq(req){
req = req || dbOpenReq;
anonymous
anonymous / test_basics.html
Created August 15, 2012 17:09
"upgradeneeded" shim for Chrome's IndexedDB
<!DOCTYPE html>
<title>upgradeneeded shim test - basics</title>
<body>
<script src="upgradeneeded.js"></script>
<script>
window.indexedDB = window.indexedDB || window.webkitIndexedDB;
function show(s) {
document.querySelector('#output').appendChild(document.createTextNode(s + "\n"));
}
@igrigorik
igrigorik / igvita.har.json
Created August 28, 2012 05:16
Sample HAR capture of igvita.com homepage
{
"log": {
"version": "1.2",
"creator": {
"name": "WebInspector",
"version": "537.1"
},
"pages": [
{
"startedDateTime": "2012-08-28T05:14:24.803Z",
@igrigorik
igrigorik / links.md
Created August 28, 2012 16:53
HAR Show links & resources
@mstssk
mstssk / gist:4234745
Created December 7, 2012 17:09
TypeScript on Ubuntu
@justinbmeyer
justinbmeyer / jsmem.md
Last active June 29, 2024 16:00
JS Memory

JavaScript Code

var str = "hi";

Memory allocation:

Address Value Description
...... ...
@cowboy
cowboy / bocoup-training-more-efficient-event-handlers.js
Created February 12, 2013 21:38
Bocoup training: More Efficient jQuery Event Handlers
// Straightforward + simple.
$("button").on("click", function(event) {
event.preventDefault();
var button = $(this);
var numberElem = button.find(".number");
var number = Number(numberElem.text()) - 1;
numberElem.text(number);
if (number === 0) {
button.prop("disabled", true);
button.off("click");