#!/usr/bin/env bash
# Assuming OS X Yosemite 10.10.4
# Install XCode and command line tools
# See https://itunes.apple.com/us/app/xcode/id497799835?mt=12#
# See https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html
xcode-select --install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************* | |
# * By Gunner Technology [email protected] | |
# * | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version as long as your provide attribution. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class CountryCodeConverter | |
{ | |
public static string ConvertThreeLetterNameToTwoLetterName(string twoLetterCountryCode) | |
{ | |
if (twoLetterCountryCode == null || twoLetterCountryCode.Length != 2) | |
{ | |
throw new ArgumentException("name must be three letters."); | |
} | |
CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.SpecificCultures); |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uploadImg: function(file, imgPreview, imgUrl) { | |
var self = this | |
console.log('file=', file) | |
imgPreview.html('<i class="icon-spinner icon-spin"></i>') | |
imgUrl.val('') | |
reader = new FileReader(); | |
reader.onload = (function(tFile) { | |
return function(evt, response) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = require('url'); | |
var http = require('http'); | |
var uri = 'http://nodejs.org'; | |
var parsed = url.parse(uri); | |
parsed.method = 'GET'; | |
// IMPORTANT! | |
parsed.agent = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id='status'></div> | |
<form id="file-upload-form" name="file-upload-form"> | |
<input type="file" id="upload-doc-file" name="upload-doc-file"> | |
</form> | |
<iframe id="postiframe" name="postiframe"></iframe> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov [email protected] 2012 | |
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler" | |
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist | |
(function(host) { | |
function Crawler() { | |
this.visitedURLs = {}; | |
}; | |