- GitHub Staff
- @niik
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
import { randomBytes as nodeCryptoGetRandomBytes } from 'crypto' | |
// Work around synchronously seeding of random buffer in the v1 | |
// version of uuid by explicitly only requiring v4. As far as I'm | |
// aware we cannot use an import statement here without causing webpack | |
// to load the v1 version as well. | |
// | |
// See | |
// https://github.com/kelektiv/node-uuid/issues/189 | |
const guid = require('uuid/v4') as (options?: { random?: Buffer }) => string |
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
// Licensed under the MIT license with <3 by GitHub | |
/// <summary> | |
/// An exponential back off strategy which starts with 1 second and then 4, 9, 16... | |
/// </summary> | |
[SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] | |
public static readonly Func<int, TimeSpan> ExponentialBackoff = n => TimeSpan.FromSeconds(Math.Pow(n, 2)); | |
/// <summary> | |
/// Returns a cold observable which retries (re-subscribes to) the source observable on error up to the |
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
/* | |
* Copyright (c) 2011 Markus Olsson | |
* | |
* var mail = string.Join(".", new string[] {"j", "markus", "olsson"}) + string.Concat('@', "gmail.com"); | |
* var blog = http://blog.freakcode.com | |
* | |
* MIT License follows. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
* software and associated documentation files (the "Software"), to deal in the Software without |
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
<?php | |
// Sample code for reading a compressed Tickster dump file in php | |
// Usage: php read-tickster-dump.php [FILENAME] | |
// http://docs.php.net/manual/sr/function.gzfile.php#54255 | |
function gzfile_get_contents($filename, $use_include_path = 0) | |
{ | |
//File does not exist | |
if( !@file_exists($filename) ) |
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
/* | |
* Copyright (c) 2008-2009 Markus Olsson | |
* var mail = string.Join(".", new string[] {"j", "markus", "olsson"}) + string.Concat('@', "gmail.com"); | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
* software and associated documentation files (the "Software"), to deal in the Software without | |
* restriction, including without limitation the rights to use, copy, modify, merge, publish, | |
* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the | |
* Software is furnished to do so, subject to the following conditions: | |
* |
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
/* | |
* Copyright (c) 2011 Markus Olsson, Tickster AB | |
* var mail = string.Join(".", new string[] {"markus", "olsson"}) + string.Concat('@', "tickster.com"); | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
* software and associated documentation files (the "Software"), to deal in the Software without | |
* restriction, including without limitation the rights to use, copy, modify, merge, publish, | |
* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the | |
* Software is furnished to do so, subject to the following conditions: | |
* |
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
/* | |
* Copyright (c) 2011 Markus Olsson | |
* var mail = string.Join(".", new string[] {"j", "markus", "olsson"}) + string.Concat('@', "gmail.com"); | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
* software and associated documentation files (the "Software"), to deal in the Software without | |
* restriction, including without limitation the rights to use, copy, modify, merge, publish, | |
* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the | |
* Software is furnished to do so, subject to the following conditions: | |
* |
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
/* | |
* Original version by Stephen Toub and Shawn Farkas. | |
* Random pool and thread safety added by Markus Olsson (freakcode.com). | |
* | |
* Original source: http://msdn.microsoft.com/en-us/magazine/cc163367.aspx | |
* | |
* Some benchmarks (2009-03-18): | |
* | |
* Results produced by calling Next() 1 000 000 times on my machine (dual core 3Ghz) | |
* |