This file contains hidden or 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
# Create application | |
mkdir dnsvc | |
cd dnsvc | |
dotnet new console | |
# Program.cs | |
using System; | |
using System.Threading; | |
namespace dnsvc |
This file contains hidden or 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
scanAndScroll: function(queryString, sourceFieldArray) { | |
var client = new $.es.Client({ | |
hosts: 'http://search.es.io:9200' | |
}); | |
var allRecords = []; | |
$("#exportProgressBarDiv").show(); | |
client.search({ |
This file contains hidden or 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
package akka.actor | |
import java.io.BufferedOutputStream | |
import java.io.FileOutputStream | |
import akka.dispatch._ | |
import java.util.concurrent.ExecutorService | |
import scala.concurrent.forkjoin.ForkJoinPool | |
import java.io.{OutputStream, Writer, OutputStreamWriter} | |
import TraversalHelper._ | |
import scala.collection.mutable.SortedSet |
This file contains hidden or 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
function handleBinaryFile(binFile) { | |
var data = findEXIFinJPEG(binFile); | |
var iptcdata = findIPTCinJPEG(binFile); | |
var xmpdata= findXMPinJPEG(binFile); // add | |
img.exifdata = data || {}; | |
img.iptcdata = iptcdata || {}; | |
img.xmpdata = xmpdata || {}; //add | |
if (callback) { | |
callback.call(img); | |
} |
This file contains hidden or 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
function xml2Object(xml) { | |
try { | |
var obj = {}; | |
if (xml.children.length > 0) { | |
for (var i = 0; i < xml.children.length; i++) { | |
var item = xml.children.item(i); | |
var attributes = item.attributes; | |
for(var idx in attributes) { | |
var itemAtt = attributes[idx]; | |
var dataKey = itemAtt.nodeName; |
This file contains hidden or 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
function findXMPinJPEG(file) { | |
var dataView = new DataView(file); | |
if (debug) console.log("Got file of length " + file.byteLength); | |
if ((dataView.getUint8(0) != 0xFF) || (dataView.getUint8(1) != 0xD8)) { | |
if (debug) console.log("Not a valid JPEG"); | |
return false; // not a valid jpeg | |
} | |
var offset = 2, |
This file contains hidden or 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
#!/bin/bash | |
set -e | |
function usage { | |
echo >&2 "Usage: $0 [ -n nodename ]" | |
exit 1 | |
} | |
while getopts ":n:" FLAG; do | |
case $FLAG in |
This file contains hidden or 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
#!/bin/bash | |
function dock() { | |
# Point docker client and docker-machine to the given node | |
eval "$(docker-machine env --shell bash $@)" | |
} | |
# Remove all containers as well as clear out dangling images | |
function cleardock() { | |
docker rm -f $(docker ps -aq) 2> /dev/null | |
docker rmi $(docker images --filter "dangling=true" -q) 2> /dev/null |
This file contains hidden or 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
using System.Web.Optimization; | |
namespace ClipTheTripWeb { | |
public class BundleConfig { | |
public static void RegisterBundles(BundleCollection bundles) { | |
var homeBundleJs = new Bundle("~/content/js/home", new JsMinify()); | |
homeBundleJs.Include( | |
"~/Content/Js/jquery.fullscreenr.js", | |
"~/Content/Js/jquery.autoSuggest.js", | |
"~/Content/Js/home.js" |
This file contains hidden or 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 class Weather { | |
public string city; | |
public int curr_temp; | |
public string curr_text; | |
public int curr_icon; | |
public List < Forecast > forecast = new List < Forecast > (); | |
} | |
public class Forecast { | |
public string day_date; |
NewerOlder