Skip to content

Instantly share code, notes, and snippets.

View nfreear's full-sized avatar

Nick Freear nfreear

View GitHub Profile
var Q = require('q')
function deep(object) {
return Q.when(object, function (object) {
if (typeof object !== "object" || object === null || object instanceof Date) {
return object;
} else {
var synchronize;
for (var i in object) {
if (Object.prototype.hasOwnProperty.call(object, i)) {
@benbalter
benbalter / jekyll-drafts.md
Last active March 12, 2024 07:39
Example of using drafts in Jekyll

Let's say your Jekyll site's directory structure looks like:

|-- _config.yml
|-- _drafts/
|   |-- a-draft-post.md
|-- _layouts/
|   |-- default.html
|-- _posts/
| |-- 2013-05-10-a-published-post
@benbalter
benbalter / excerpt.md
Last active April 11, 2025 19:15
Example of how to use Jekyll's `excerpt` tag.

If your post looked something like:

# Awesome Blog Post

Here is an example post to show how to use the new `excerpt` tag.

The excerpt tag provides a quick and easy way to tease a post by exposing only the first paragraph such as on a blog index page.
@vasilisvg
vasilisvg / dabblet.css
Created April 24, 2013 09:00
A simple menu with a :hover action
/**
* A simple menu with a :hover action
*/
html {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
font: 100%/2.5 helvetica, arial;
}
@nijikokun
nijikokun / base64-utf8.module.js
Last active December 12, 2024 13:00
Javascript Base64 UTF8 for the Browser / Server. Base64 UTF-8 Encoding and Decoding Libraries / Modules for AMD, CommonJS, Nodejs and Browsers. Cross-browser compatible.
// UTF8 Module
//
// Cleaner and modularized utf-8 encoding and decoding library for javascript.
//
// copyright: MIT
// author: Nijiko Yonskai, @nijikokun, [email protected]
(function (name, definition, context, dependencies) {
if (typeof context['module'] !== 'undefined' && context['module']['exports']) { if (dependencies && context['require']) { for (var i = 0; i < dependencies.length; i++) context[dependencies[i]] = context['require'](dependencies[i]); } context['module']['exports'] = definition.apply(context); }
else if (typeof context['define'] !== 'undefined' && context['define'] === 'function' && context['define']['amd']) { define(name, (dependencies || []), definition); }
else { context[name] = definition.apply(context); }
@emiller42
emiller42 / gist:4982462
Last active October 17, 2022 19:00
Adding Tomcat to MAMP
1) Install MAMP normally
2) Download the latest binary of tomcat from http://tomcat.apache.org/ and extract it into the MAMP folder
(you should now have a /Applications/MAMP/apache-tomcat-version folder)
3) Create a link to the apache-tomcat folder:
ln -s /Applications/apache-tomcat-7.0.37/ tomcat
4) Make sure all the binaries are executable:
cd /Applications/tomcat/bin
@nfreear
nfreear / wai-aria-landmark-roles-html5.haml
Created February 5, 2013 13:17
HTML5 boilerplate with WAI-ARIA landmark roles (IET-LTT, ou, qa, Haml)
<!doctype html>
%html{:lang => "en"}
%meta{:content => "IE=edge", "http-equiv" => "X-UA-Compatible"}/
%meta{:charset => "utf-8"}/
/[if lt IE 9]
<script src="//html5shim.googlecode.com/svn/trunk/html5-els.js"></script>
<script> document.createElement("main") </script>
%title MY TITLE
%header{:role => "banner"}
%h1 BANNER
@yefuchs
yefuchs / gfw_contributors.md
Last active April 11, 2025 14:50
GFW Contributers

#The Great Firewall (GFW) Contributors List

注:数据来源为 dblp 和 cndblp, 下面括号中的数字表示 dblp 中显示的跟方滨兴合作论文的数量

###Binxing Fang (方滨兴)

中国工程院院士,北京邮电大学教授,中国科学院计算技术研究所网络方向首席科学家
http://en.wikipedia.org/wiki/Fang_Binxing

// parseUri 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License
function parseUri (str) {
var o = parseUri.options,
m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
uri = {},
i = 14;
@adamloving
adamloving / temporary-email-address-domains
Last active April 16, 2025 06:03
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com