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
[].forEach.call(document.querySelectorAll('a'), function(a) { | |
var href = a.getAttribute('href'); | |
if(href && href.indexOf('http:')>-1) | |
console.log(href); | |
}); |
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
for %%f in (*.jpg) do jpegtran -copy none -optimize %%f %%~nf.jpg |
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
using StructureMap; | |
using System; | |
using System.ServiceModel; | |
namespace MyWcfService.Classes | |
{ | |
public class CustomServiceHost : ServiceHost | |
{ | |
public CustomServiceHost(IContainer container, Type serviceType, params Uri[] baseAddresses) | |
: base(serviceType, baseAddresses) |
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
-------------------------------------------------------------------------------- | |
-- Multi HINCRBY via a LUA script | |
-- Increments a list of fields in a hash stored at key. | |
-- KEYS : key of the hash | |
-- ARGS : list of field/increment | |
-- Note : Because a script is executed in an atomic way, you should always use this script to increment fields values. | |
-- ex via cli : redis-cli --eval hmincr.lua myhash , 1 10 2 20 | |
-------------------------------------------------------------------------------- | |
-- gets multiple fields from a redis hash as a dictionary |
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
using System; | |
using System.Linq; | |
namespace MyFunnyProject | |
{ | |
internal static class EnumHelper | |
{ | |
public static class EnumCache<TEnum> | |
{ | |
public readonly static TEnum[] Values = null; |
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
// npm install native-hdr-histogram prob.js redis | |
var prob = require('prob.js'); | |
var redis = require("redis"); | |
var Histogram = require('native-hdr-histogram'); | |
//generate fake response times | |
var random = prob.lognormal(0, 1.0); // μ = 0, σ = 1.0 | |
var histogram = new Histogram(1, 120 * 1000); | |
var client = redis.createClient({ host: 'localhost', port: 6379 }); |
OlderNewer