Skip to content

Instantly share code, notes, and snippets.

View ericrange's full-sized avatar

Eric Range ericrange

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ericrange on github.
  • I am ericrange (https://keybase.io/ericrange) on keybase.
  • I have a public key whose fingerprint is B522 E94A 7F7A A00B 0BF9 F36D 95A5 D9CD 26B5 21A4

To claim this, I am signing this object:

@ericrange
ericrange / dh-usage.js
Created March 31, 2016 12:59 — forked from bellbind/dh-usage.js
[nodejs][javascript] Diffie-Hellman key exchange by nodejs-0.5
// node.js 0.5 Diffie-Hellman example
var assert = require("assert");
var crypto = require("crypto");
// the prime is shared by everyone
var server = crypto.createDiffieHellman(512);
var prime = server.getPrime();
// sharing secret key on a pair
@ericrange
ericrange / update-packages.js
Created August 29, 2014 18:42
Updates package versions in package.json
var fs = require("fs");
var exec = require("child_process").exec;
var file = __dirname + "/package.json";
var Commands = [];
var CommandIndex = 0;
fs.readFile(file, "utf8", function (err, data) {
if (err) {
console.log("Error: " + err);
@ericrange
ericrange / gist:8505701
Created January 19, 2014 14:31
LESS mixin
.transition (@transition) {
-webkit-transition: @transition;
-moz-transition: @transition;
-ms-transition: @transition;
-o-transition: @transition;
transition: @transition;
}
<?php
/* include the csscache lib */
include("csscache.php");
/* optional, make sure caching is turned on.
It's not necessary but improves the browser performance. */
header("Cache-Control: public");
?>
<html>
<head>
<link rel="stylesheet" href="/css/cache/tmp/22d992b5.css" type="text/css">
</head>
<body>
<h1>CSSCache</h1>
<p class="lead">A PHP caching engine for CSS</p>
</body>
</html>
<html>
<head>
<?php echo CSSCache::ressource(array(
/* Your CSS files */
"/css/normalize.css",
"/css/bootstrap.css",
"less/global.less",
"less/home.less",
"less/changelog.less"
),