Skip to content

Instantly share code, notes, and snippets.

Avatar

Lance Pollard lancejpollard

View GitHub Profile
@lancejpollard
lancejpollard / meta-tags.md
Created Mar 5, 2012
Complete List of HTML Meta Tags
View meta-tags.md

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@lancejpollard
lancejpollard / cursor-position.js
Created Sep 22, 2012
Get Cursor Position in Terminal with Node.js
View cursor-position.js
module.exports = function(callback) {
require('child_process').exec('./cursor-position.sh', function(error, stdout, stderr) {
callback(error, JSON.parse(stdout));
});
}
@lancejpollard
lancejpollard / node-folder-structure-options.md
Created Nov 28, 2011
What is your folder-structure preference for a large-scale Node.js project?
View node-folder-structure-options.md

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
@lancejpollard
lancejpollard / dnsmasq_setup_osx.md
Created Jul 26, 2020 — forked from eloypnd/dnsmasq_setup_osx.md
wildcard DNS record on OS X in localhost development with dnsmasq
View dnsmasq_setup_osx.md

wildcard DNS in localhost development

$ brew install dnsmasq
   ...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
  • edit /usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
@lancejpollard
lancejpollard / binary-addition.js
Created Jul 6, 2020 — forked from nealfennimore/binary-addition.js
Binary addition in javascript
View binary-addition.js
/**
* Add two bits together and get resulting bits
*
* @param {Number} a bit a
* @param {Number} b bit b
* @returns {Array<Number, Number>} Carry and sum as a result of addition
*/
function addBits(a, b){
return [ +( a && b ), +( a !== b ) ];
View html5-dom.html
<div class='document' role='document'>
<section class='header container' role='definition'>
<div class='navigation'>
<div class='frame'>
<header class='logo'>
<h1></h1>
</header>
<nav class='menu' role='directory'>
<ul>
<li>
View memcpy.asm
page ,132
title memcpy - Copy source memory bytes to destination
;***
;memcpy.asm - contains memcpy and memmove routines
;
; Copyright (c) Microsoft Corporation. All rights reserved.
;
;Purpose:
; memcpy() copies a source memory buffer to a destination buffer.
; Overlapping buffers are not treated specially, so propogation may occur.
@lancejpollard
lancejpollard / chacha20.js
Created May 29, 2020 — forked from rumkin/chacha20.js
Chacha20-Poly1305.js
View chacha20.js
/* chacha20 - 256 bits */
// Written in 2014 by Devi Mandiri. Public domain.
//
// Implementation derived from chacha-ref.c version 20080118
// See for details: http://cr.yp.to/chacha/chacha-20080128.pdf
function U8TO32_LE(x, i) {
return x[i] | (x[i+1]<<8) | (x[i+2]<<16) | (x[i+3]<<24);
}
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:

You can’t perform that action at this time.