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
from bitarray import bitarray | |
import mmh3 | |
from math import log, pow, ceil | |
class BloomFilter: | |
def __init__(self, size, hash_count): | |
self.size = size | |
self.hash_count = hash_count | |
self.bit_array = bitarray(size) | |
self.bit_array.setall(0) |
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
// ==UserScript== | |
// @name Hodor | |
// @namespace gamerswithjobs | |
// @description Makes everything sound the same | |
// @exclude /github/ | |
// @author Chris Doggett | |
// ==/UserScript== | |
// Special thanks to Jeremy Banks at http://stackoverflow.com/a/6834930/64203 | |
var load,execute,loadAndExecute;load=function(a,b,c){var d;d=document.createElement("script"),d.setAttribute("src",a),b!=null&&d.addEventListener("load",b),c!=null&&d.addEventListener("error",c),document.body.appendChild(d);return d},execute=function(a){var b,c;typeof a=="function"?b="("+a+")();":b=a,c=document.createElement("script"),c.textContent=b,document.body.appendChild(c);return c},loadAndExecute=function(a,b){return load(a,function(){return execute(b)})}; |
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
// ==UserScript== | |
// @name SludgeHammer | |
// @namespace gamerswithjobs | |
// @description Replaces marketing speak with English | |
// @exclude /github/ | |
// @author Chris Doggett | |
// ==/UserScript== | |
// Special thanks to Jeremy Banks at http://stackoverflow.com/a/6834930/64203 | |
var load,execute,loadAndExecute;load=function(a,b,c){var d;d=document.createElement("script"),d.setAttribute("src",a),b!=null&&d.addEventListener("load",b),c!=null&&d.addEventListener("error",c),document.body.appendChild(d);return d},execute=function(a){var b,c;typeof a=="function"?b="("+a+")();":b=a,c=document.createElement("script"),c.textContent=b,document.body.appendChild(c);return c},loadAndExecute=function(a,b){return load(a,function(){return execute(b)})}; |
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
// ==UserScript== | |
// @name I Didn't Hear Anything | |
// @namespace gamerswithjobs | |
// @description Increases the number of potential Tannhauserings | |
// @include http://www.gamerswithjobs.com/node/* | |
// @author Chris Doggett | |
// ==/UserScript== | |
// Special thanks to Jeremy Banks at http://stackoverflow.com/a/6834930/64203 | |
var load,execute,loadAndExecute;load=function(a,b,c){var d;d=document.createElement("script"),d.setAttribute("src",a),b!=null&&d.addEventListener("load",b),c!=null&&d.addEventListener("error",c),document.body.appendChild(d);return d},execute=function(a){var b,c;typeof a=="function"?b="("+a+")();":b=a,c=document.createElement("script"),c.textContent=b,document.body.appendChild(c);return c},loadAndExecute=function(a,b){return load(a,function(){return execute(b)})}; |
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.Collections.Generic; | |
using System.Linq; | |
namespace Util | |
{ | |
public static class Enums | |
{ | |
#region Parse Methods | |
/// <summary> |
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
/// <summary> | |
/// Given a password and salt string, along with an algorithm (MVC4 defaults to HMACSHA256), calculates the password's | |
/// hash value as stored in the DB. | |
/// </summary> | |
/// <param name="password">Plaintext password</param> | |
/// <param name="salt">Base64 string containing user's salt value</param> | |
/// <param name="hashingAlgorithm">Known .NET crypto algorithm name. Defaults to MVC4's default of HMACSHA256.</param> | |
/// <returns>Base64-encoded password hash string</returns> | |
/// <exception cref="CryptographicException">If hashingAlgorithm is unknown to .NET</exception> | |
private string HashPassword(string password, string salt, string hashingAlgorithm = "HMACSHA256") { |
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
# Make sure we're installing into user's own Powershell Module path, and not the global one | |
$PSModuleDir = "$($ENV:PsModulePath)".Split(";") | Select-String "$ENV:UserName" | foreach {$_.Line } | Select-Object -First 1 | |
function ModuleInstalled([parameter(Mandatory=$true)][string] $moduleName) { | |
return ((Get-Module "$moduleName") -ne $null) | |
} | |
function InstallPlugins([parameter(Mandatory=$true)][string[]] $moduleNames) { | |
if (-NOT (Test-Path "$PSModuleDir\PsGet\PsGet.psm1")) { | |
New-Item -ItemType Directory -Force -Path "$PSModuleDir\PsGet" | Out-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
{ | |
RelativePath: "api/products/get?sort_by={sort_by}&sort_order={sort_order}", | |
Method: "GET", | |
SupportedResponseFormats: [ | |
"application/json", | |
"text/json" | |
], | |
SupportedEncodings: [ | |
"utf-8", | |
"utf-16" |
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.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Hosting; | |
using System.Web.Http; | |
using System.Web.Http.Description; | |
using NLog; | |
namespace Project.Controllers.API { | |
/// |
NewerOlder