Just install connect from npm. Run this in a directory that you'll like to serve static content from. To run on a specific port set ENV "StaticPort"
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
/** | |
* Object descriptor | |
**/ | |
var a = { | |
prop1 : 14 | |
} | |
var descriptorObj1 = Object.getOwnPropertyDescriptor(a, 'prop1'); |
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
var a, b, c, d, e; | |
a = function(obj) { | |
return this; | |
} | |
// when you call the function in 'function form' 'this' is window object | |
a(); // window |
-
Simplest intro to git by github and codeschool - Try Git
-
[Intro to github]
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
var connect = require('connect'), | |
WebSocketServer = require('websocket').server, | |
app = connect.createServer(); | |
app.use(connect.static(process.cwd())); | |
app.use(connect.router(function(app){ | |
app.get("/", function(req, resp) { | |
resp.write("Hola !"); | |
resp.end(); |
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
#!/usr/bin/env ruby | |
require "nokogiri" | |
require "open-uri" | |
def download(url, output_file) | |
exit unless system("wget -c #{url} --load-cookies=cookies.txt -O #{output_file}") | |
end | |
def download_pages |
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
;;; auto-remove.el --- Auto remove unused functions in python | |
;;; Commentary: | |
;; Uses external tool autoflake to remove unused imports from a Python file. | |
;;; Code: | |
(defcustom python-autoflake-path (executable-find "autoflake") | |
"Autoflake executable path. |
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
import logging | |
import time | |
logger = logging.getLogger(__name__) | |
def useful(): | |
logger.debug('Hello from webapplib!') | |
time.sleep(0.01) |
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
OlderNewer