Skip to content

Instantly share code, notes, and snippets.

View Couto's full-sized avatar
👽
Did you raid area 51?

Luís Couto Couto

👽
Did you raid area 51?
View GitHub Profile
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active June 9, 2024 23:19
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
var metas = document.getElementsByTagName('meta');
var i;
if (navigator.userAgent.match(/iPhone/i)) {
for (i=0; i<metas.length; i++) {
if (metas[i].name == "viewport") {
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
}
}
@paulirish
paulirish / data-markdown.user.js
Last active February 6, 2024 10:41
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
@lancejpollard
lancejpollard / node-folder-structure-options.md
Created November 28, 2011 01:50
What is your folder-structure preference for a large-scale Node.js project?

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin
@qrush
qrush / Inconsolata-dz-Powerline.otf
Created January 11, 2012 16:50
vim-powerline patched fonts
@gazoombo
gazoombo / .tmux.conf
Created January 27, 2012 20:27
My current ~/.tmux.conf
# Solarized colorscheme/theme from
source-file git/github/tmux-colors-solarized/tmuxcolors.conf
# Report that we can handle 256 colors
set -g default-terminal "screen-256color"
# Rebind prefix to avoid conflicts
#unbind C-b
#set -g prefix C-q
#bind C-q send-prefix
@bradland
bradland / gencert.sh
Created January 27, 2012 20:39
Generate a self-signed SSL cert
#!/bin/bash
# Bash shell script for generating self-signed certs. Run this in a folder, as it
# generates a few files. Large portions of this script were taken from the
# following artcile:
#
# http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html
#
# Additional alterations by: Brad Landers
# Date: 2012-01-27
@miyagawa
miyagawa / gist:1912431
Created February 26, 2012 02:53
How to represent Links in REST

How to embed HATEOAS/Link inside JSON

HTTP Headers

For HTTP headers it's quite straightforward: draft-nottingham-http-link-header defines this.

Link: <http://example.com/>; rel="previous"; titile="Previous chapter"
@cowboy
cowboy / ctor-proto.js
Created March 2, 2012 17:23
JavaScript: Prototypal Inheritance, Extend
// Also see http://michaux.ca/articles/class-based-inheritance-in-javascript
function extend(Super, Sub) {
// By using a dummy constructor, initialization side-effects are eliminated.
function Dummy() {}
// Set dummy prototype to Super prototype.
Dummy.prototype = Super.prototype;
// Create Sub prototype as a new instance of dummy.
Sub.prototype = new Dummy();
// The .constructor propery is really the Super constructor.
Sub.baseConstructor = Sub.prototype.constructor;