Skip to content

Instantly share code, notes, and snippets.

View itsananderson's full-sized avatar

Will Anderson itsananderson

View GitHub Profile
@itsananderson
itsananderson / atom.bat
Created May 11, 2014 16:40
Better startup file for Atom
@echo off
SET DIR=%~dp0%
start %DIR%..\lib\atom.0.0.0.1\tools\atom.exe %*
@itsananderson
itsananderson / feed-response.txt
Last active August 29, 2015 14:01
Error in "kpm restore"
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="https://my-feed.cloudapp.net/api/v2/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
<title type="text">FindPackagesById</title>
<id>https://my-feed.cloudapp.net/api/v2/FindPackagesById</id>
<updated>2014-05-13T14:55:03Z</updated>
<author>
<name />
</author>
<link rel="self" title="FindPackagesById" href="FindPackagesById" />
</feed>
var http = require('http');
var responseHandler = function(response) {
if (response.headers.location) {
http.get(response.headers.location, responseHandler);
// If I leave this off, the node process takes ~45 seconds to exit.
// Presumably it's waiting for a listener to attach to the stream
response.on('data', function() {});
} else {
@itsananderson
itsananderson / promises.html
Last active August 29, 2015 14:02
How to chain promises and such
<!DOCTYPE html>
<html>
<head>
<script src="/q.js"></script>
<script src="/lodash.js"></script>
<script>
function makePromise(val) {
var deferred = Q.defer();
deferred.resolve(val);
return deferred.promise;
@itsananderson
itsananderson / build.cmd
Created July 1, 2014 00:31
Node Webkit Setup - Windows
mkdir build
taskkill /F /im mimic.exe
copy /b bin\node-webkit\* build
pushd source
del ..\build\mimic.nw
@itsananderson
itsananderson / README.md
Created July 1, 2014 22:52
gVim Scripts for Windows

Place these files in your vim bin/ folder. Most likely one of the following:

C:\Program Files\vim\bin
C:\Program Files (x86)\vim\bin

@itsananderson
itsananderson / fib-gen.js
Created July 22, 2014 06:28
Fibonacci generator in ES6
function* fib() {
var a = 0;
var b = 1;
while(true) {
yield a;
b = a+b;
a = b-a;
}
}
@itsananderson
itsananderson / repeating-client.cpp
Created July 24, 2014 10:38
Arduino client to send requests in a loop
/*
Repeating Web client
This sketch connects to a a web server and makes a request
using a Wiznet Ethernet shield. You can use the Arduino Ethernet shield, or
the Adafruit Ethernet shield, either one will work, as long as it's got
a Wiznet Ethernet module on board.
This example uses DNS, by assigning the Ethernet client with a MAC address,
IP address, and DNS address.
@itsananderson
itsananderson / build-status.cpp
Created July 25, 2014 02:18
Build Status Monitor
/*
Repeating Web client
This sketch connects to a a web server and makes a request
using a Wiznet Ethernet shield. You can use the Arduino Ethernet shield, or
the Adafruit Ethernet shield, either one will work, as long as it's got
a Wiznet Ethernet module on board.
This example uses DNS, by assigning the Ethernet client with a MAC address,
IP address, and DNS address.
var paths = require('./paths');
gulp.task('lint', function() {
gulp.src(paths.app.concat(paths.test))
.pipe(lint());
});
gulp.task('minify', function() {
gulp.src(paths.app)
.pipe(minify());