Skip to content

Instantly share code, notes, and snippets.

@kensykora
kensykora / validate-site-html.ps1
Created May 28, 2014 14:38
W3C HTML Sitemap-based Site Validator
param ([Parameter(Mandatory=$True)][string]$SitemapUrl,
[int]$Max=0)
function Validate($url) {
if(-not $url.StartsWith("http")) {
$parsed = [System.Uri]$SitemapUrl
$url = "{0}://{1}{2}" -f $parsed.Scheme, $parsed.Host, $url
}
@mikermcneil
mikermcneil / bootstrap.js
Created July 8, 2013 14:05
bootstrap.js :: unit test demo for Sails v0.9
/**
* Bootstrap
*/
var Sails = require('sails'),
Utils = require('./utils'),
Database = require('./database'),
localConf = require('../../config/local');
/**
@desandro
desandro / require-js-discussion.md
Created January 31, 2013 20:26
Can you help me understand the benefit of require.js?

I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.

From Require.js - Why AMD:

The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"

I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.


@jfromaniello
jfromaniello / gist:4087861
Last active February 6, 2022 03:53
socket-io.client send the cookies!
/*
* Little example of how to use ```socket-io.client``` and ```request``` from node.js
* to authenticate thru http, and send the cookies during the socket.io handshake.
*/
var io = require('socket.io-client');
var request = require('request');
/*
* This is the jar (like a cookie container) we will use always
@ankbul
ankbul / howto-filemerge-git-osx.md
Created May 14, 2012 19:16 — forked from bkeating/howto-filemerge-git-osx.md
HOWTO: Using FileMerge (opendiff) with Git on OSX

HOWTO: Using FileMerge (opendiff) with Git on OSX

FileMerge (opendiff) can really come in handy when you need to visually compare merging conflicts. Other times it's just a nice visual way to review your days work.

The following method works by creating a simple bash script (git-diff-cmd.sh) that sets us up with the proper command line arguments for Git to pass off files to FileMerge.

@artero
artero / launch_sublime_from_terminal.markdown
Last active January 25, 2024 16:57 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation