Skip to content

Instantly share code, notes, and snippets.

@max-mapper
max-mapper / 0.md
Last active May 12, 2025 13:51
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

# Description:
# Issue various Git commands on remote servers
#
# Commands:
# Hubot create <type> repository <nickname> = <user>/<repository> - Define a repository for linking
# Hubot create server <nickname> - Define a new server
# Hubot set <property> on server <nickname> to <value> - Set a server's user, address, directory, or repo
# Hubot alias server <nickname> to <alias> - Create an alias to a server
# Hubot describe server <nickname> - Show details of a server
# Hubot delete server <nickname> - Delete server details
@tommcdo
tommcdo / add-site.sh
Last active January 18, 2017 07:18
Quick script to add a local site to your Apache server.
#!/bin/bash
SITE_BASE=/home/tommcdo/sites # Base directory into which sites are installed
LOCAL_TLD=local # TLD for local sites, e.g. http://mysite.local
DOC_ROOT=public_html # Subdirectory of main folder for document root
# Ensure root privileges
if [[ $EUID -ne 0 ]]; then
echo >&2 "This script can only be run as root"
exit
function! s:browser_from_model()
normal gg
call search('Model_DataSource_.', 'e')
normal ye
sp
execute "Ag \"'name' => '".tolower(@@)."'\" modules/browsers/classes"
execute "normal \<CR>"
ccl
endfunction
@justlaputa
justlaputa / jenkins-api.md
Last active November 20, 2024 11:56
Jenkins Json API

jobs

jenkins_url + /api/json?tree=jobs[name,color]

builds

jenkins_url + /job/${job_name}/api/json?tree=builds[number,status,timestamp,id,result]

last build

@nilium
nilium / key-bindings.json
Created August 11, 2012 23:14
A Sublime Text 2 plugin to enable running multiple commands in any given context from a single key binding.
[
{
"keys": ["ctrl+w"],
"command": "run_multiple",
"args": {
"commands": [
{"command": "find_under_expand", "args": null, "context": "window"},
{"command": "show_panel", "args": {"panel": "find"}, "context": "window"}
]
}
@kconragan
kconragan / keyrepeat.shell
Last active October 16, 2025 10:31
Enable key repeat in Apple Lion for Sublime Text in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@ChrisWills
ChrisWills / .screenrc-main-example
Created November 3, 2011 17:50
A nice default screenrc
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
@jehiah
jehiah / git-branch-status
Last active January 20, 2025 12:53
show git ahead/behind info for branches
moved to github --> https://github.com/bill-auger/git-branch-status/
@nuxlli
nuxlli / sublime_text_2_useful_shortcuts.md
Created September 9, 2011 18:51 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

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