Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

EGOIST egoist

🏠
Working from home
Block or report user

Report or block egoist

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@solderjs
solderjs / readme.md
Last active Sep 23, 2019
How to publish packages to NPM
View readme.md

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser
@tedmiston
tedmiston / nodejs-tcp-example.js
Last active Sep 22, 2019
Node.js TCP client and server example
View nodejs-tcp-example.js
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active Sep 22, 2019
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@domenic
domenic / auto-deploy.md
Last active Sep 20, 2019
Auto-deploying built products to gh-pages with Travis
View auto-deploy.md

Auto-deploying built products to gh-pages with Travis

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

Create a compile script

You want a script that does a local compile to e.g. an out/ directory. Let's call this compile.sh for our purposes, but for your project it might be npm build or gulp make-docs or anything similar.

The out/ directory should contain everything you want deployed to gh-pages. That almost always includes an index.html.

@niallo
niallo / gist:3109252
Created Jul 14, 2012
Parse Github `Links` header in JavaScript
View gist:3109252
/*
* parse_link_header()
*
* Parse the Github Link HTTP header used for pageination
* http://developer.github.com/v3/#pagination
*/
function parse_link_header(header) {
if (header.length == 0) {
throw new Error("input must not be of zero length");
}
View trello-css-guide.md

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@textarcana
textarcana / git-log2json.sh
Last active Sep 18, 2019
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features 😀
View git-log2json.sh
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active Sep 18, 2019
Hyperlinks in Terminal Emulators
View Hyperlinks_in_Terminal_Emulators.md
@trinitronx
trinitronx / xcode-cli-tools.sh
Last active Sep 16, 2019
Script to download & install XCode Command Line tools on OSX 10.7 or 10.8. Lifted from jedi4ever/veewee template.
View xcode-cli-tools.sh
#!/bin/sh
OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}')
# Get Xcode CLI tools
# https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/index-3905972D-B609-49CE-8D06-51ADC78E07BC.dvtdownloadableindex
# https://developer.apple.com/downloads/index.action
TOOLS=clitools.dmg
if [ ! -f "$TOOLS" ]; then
if [ "$OSX_VERS" -eq 7 ]; then
DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg
@isaacs
isaacs / comma-first-var.js
Created Apr 6, 2010
A better coding convention for lists and object literals in JavaScript
View comma-first-var.js
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",
You can’t perform that action at this time.