This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In my heavy search to both understand the underline code and functionality of most | |
of the libraries i am building and managing,the one pure function that seems to have always eluded me was the hasOwnProperty function attributed to all JS objects. | |
I know browser support is widespread and i thank God for that,but am not the | |
type to just use something i don't understand,after a long, | |
mind bending,play testing in the js console to both understand how the prototyping system | |
works,how and why new objects point directly to the prototype,i finally came up with a shim that works 90% of the time even far more better than that located in the Modernizr annotated source code,ya you heard me better. | |
It seems the trick was really on how prototypes and constructors are | |
assigned and also depends on you how deep you wish to go into that tree,since the 'in'(for in loop and others) handle going deep within the prototype | |
and object tree there is not need to try to recreate that,therefore this function searches only one level |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iterable: function(collection,eachfunc,finish){ | |
if(!collection || !eachfunc) return; | |
//handles management of next call for collection,be it arrays or objects | |
var len,keys,self = this,isArray = false; | |
if(this.isObject(collection)){ keys = this.keys(collection); len = keys.length; } | |
if(this.isArray(collection)){ isArray = true; len = collection.length;} | |
eachfunc.collection = collection; | |
eachfunc.size = len; | |
eachfunc.__ri__ = len - 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
06/24/2013 01:35:22 AM - Enabling debug logging | |
06/24/2013 01:35:22 AM - i3 4.5.1 (2013-03-18, branch "tags/4.5.1") starting | |
06/24/2013 01:35:22 AM - main.c:main:527 - root_depth = 24, visual_id = 0x00000021. | |
06/24/2013 01:35:22 AM - Parsing configfile /home/punchy/.i3/config | |
deciding for version 4 due to this line: # i3 config file (v4) | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 1): # i3 config file (v4) | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 2): # | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 3): # Please see http://i3wm.org/docs/userguide.html for a complete reference! | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 4): # | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 5): # This config file uses keycodes (bindsym) and was written for the QWERTY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
06/24/2013 01:35:22 AM - Enabling debug logging | |
06/24/2013 01:35:22 AM - i3 4.5.1 (2013-03-18, branch "tags/4.5.1") starting | |
06/24/2013 01:35:22 AM - main.c:main:527 - root_depth = 24, visual_id = 0x00000021. | |
06/24/2013 01:35:22 AM - Parsing configfile /home/punchy/.i3/config | |
deciding for version 4 due to this line: # i3 config file (v4) | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 1): # i3 config file (v4) | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 2): # | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 3): # Please see http://i3wm.org/docs/userguide.html for a complete reference! | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 4): # | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 5): # This config file uses keycodes (bindsym) and was written for the QWERTY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
06/24/2013 01:35:22 AM - Enabling debug logging | |
06/24/2013 01:35:22 AM - i3 4.5.1 (2013-03-18, branch "tags/4.5.1") starting | |
06/24/2013 01:35:22 AM - main.c:main:527 - root_depth = 24, visual_id = 0x00000021. | |
06/24/2013 01:35:22 AM - Parsing configfile /home/punchy/.i3/config | |
deciding for version 4 due to this line: # i3 config file (v4) | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 1): # i3 config file (v4) | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 2): # | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 3): # Please see http://i3wm.org/docs/userguide.html for a complete reference! | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 4): # | |
06/24/2013 01:35:22 AM - config_parser.c:parse_config:315 - CONFIG(line 5): # This config file uses keycodes (bindsym) and was written for the QWERTY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"log" | |
"gopkg.in/lxc/go-lxc.v2" | |
"fmt" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// safeSplit handles quoting well for commands for use with github.com/jmervine/exec/v2 | |
// | |
// Examples: | |
// > safeSplit("/bin/bash bash -l -c 'echo \"foo bar bah bin\"'") | |
// => []string{"/bin/bash", "-l", "-c", "echo \"foo bar bah bin\""} | |
// > safeSplit("docker run --rm -it some/image bash -c \"npm test\"") | |
// => []string{"docker", "run", "--rm", "-it", "some/image", "bash", "-c", "npm test"} | |
//---- | |
// package main | |
// import "github.com/jmervine/exec/v2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"encoding/json" | |
"errors" | |
"fmt" | |
"io" | |
"net/http" | |
"regexp" |
OlderNewer