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 | |
// Helper function. | |
if (! function_exists('timer')) { | |
function timer($expression) | |
{ | |
$start = microtime(true); | |
if ($expression instanceof Closure) { | |
$expression(); |
When using MSVC Rust on Windows, everything typically works out of the box, up until you decide to do some web stuff with hyper. Suddenly a new dependency, openssl, is failing to build and you have no idea how to fix it. Fortunately this guide is here to save you!
WARNING: OpenSSL 1.1 support was only added in openssl-sys = "0.9"
. Older versions only support up to OpenSSL 1.0.2. sfackler/rust-openssl#452
- First you will need to download and install OpenSSL itself. You can download an installer from http://slproweb.com/products/Win32OpenSSL.html. In particular you want the newest version and not the light version. Make sure it matches the version of Rust you have, if you're using
x86_64-pc-windows-msvc
you will want Win64, and if you're usingi9686-pc-windows-msvc
you will want Win32. For the purpose of example I have installedWin64 OpenSSL v1.0.2h
. - If all went well you should now have OpenSSL installed somewh
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
/** | |
* Demonstrate execution order of code in Jest/Jasmine | |
*/ | |
function resolveAfter2Seconds(message) { | |
return new Promise((resolve) => { | |
setTimeout(() => { | |
resolve(message) | |
}, Math.ceil(Math.random() * 5000)) | |
}) |
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
/** | |
* A Connection handler for Amazon ES. | |
* | |
* Uses the aws-sdk to make signed requests to an Amazon ES endpoint. | |
* Define the Amazon ES config and the connection handler | |
* in the client configuration: | |
* | |
* var es = require('elasticsearch').Client({ | |
* hosts: 'https://amazon-es-host.us-east-1.es.amazonaws.com', | |
* connectionClass: require('http-aws-es'), |
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
#!/bin/sh | |
sed -i.default "s/^zend_extension=/;zend_extension=/" /usr/local/etc/php/7.0/conf.d/ext-xdebug.ini | |
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php70.plist | |
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php70.plist | |
echo "xdebug disabled" |
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
// declarations | |
var positions = []; | |
// Returns a random integer between min (included) and max (excluded) | |
// Using Math.round() will give you a non-uniform distribution! | |
function getRandomInt(min, max) { | |
return Math.floor(Math.random() * (max - min)) + min; | |
} | |
// generate random positions |
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 | |
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s", | |
//\u000A\u002F\u002A | |
class PhpJava { | |
static function main() { | |
echo(//\u000A\u002A\u002F | |
"Hello World!"); | |
}} | |
//\u000A\u002F\u002A | |
PhpJava::main(); |
Crates ordered by the number of dependent crates that were newly added to crates.io since the begining of April
- serde 39
- clap 35
- serde_json 34
- serde_derive 34
- libc 32
- log 27
- rand 25
- lazy_static 25
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Object.observe</title> | |
</head> | |
<body> | |
<h1 reactive>Title here</h1> | |
<p reactive>Text here</p> | |
<hr /> | |
<p><b>Hey!</b> Open up the console and change the <tt>title</tt> |