Skip to content

Instantly share code, notes, and snippets.

View r4j4h's full-sized avatar

Jasmine Hegman r4j4h

View GitHub Profile
@pvgomes
pvgomes / gist:9f19e80454bb56565ee9
Created November 19, 2014 11:45
Difference between save and export
As I described in my last post (http://tuhrig.de/difference-between-save-and-export-in-docker), there are two ways to persist a Docker images or container:
A Docker image can be saved to a tarball and loaded back again. This will preserve the history of the image.
# save the image to a tarball
docker save <IMAGE NAME> > /home/save.tar
# load it back
docker load < /home/save.tar
A Docker container can be exported to a tarball and imported back again. This will not preserve the history of the container.
module thrift_vibe;
import std.range;
import thrift.codegen.base : isService;
import thrift.protocol.base;
import thrift.protocol.processor;
import thrift.transport.base;
import thrift.util.cancellation;
import vibe.core.log;
import vibe.core.net;
@abreckner
abreckner / waitsForAndRuns.js
Created May 9, 2014 01:56
Jasmine 2 plug in to re-enable waitsFor and runs functionality
// This is the equivalent of the old waitsFor/runs syntax
// which was removed from Jasmine 2
waitsForAndRuns = function(escapeFunction, runFunction, escapeTime) {
// check the escapeFunction every millisecond so as soon as it is met we can escape the function
var interval = setInterval(function() {
if (escapeFunction()) {
clearMe();
runFunction();
}
}, 1);
@samselikoff
samselikoff / xAxis.js
Last active August 29, 2015 13:58
Sample implementation of xAxis component using d3.chart
// Use the axis in the initialize method of your BarChart, like this:
d3.chart('BarChart', {
initialize: function() {
...
chart.xAxis = this.base.select('g').append('g').chart('xAxis', {parent: this});
this.attach('axis', chart.xAxis);
}
@denji
denji / nginx-tuning.md
Last active May 24, 2024 10:14
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@MartinNowak
MartinNowak / BvSshServer-Settings.wst
Last active April 14, 2023 03:52
Preparing a Win7x64 base box.

How @extend Works

@akhleung is working on hcatlin/libsass and was wondering how @extend is implemented in the Ruby implementation of Sass. Rather than just tell him, I thought I'd write up a public document about it so anyone who's porting Sass or is just curious about how it works can see.

Note that this explanation is simplified in numerous ways. It's intended to explain the most complex parts of a basic correct @extend transformation, but it leaves out numerous details that will be important if full Sass compatibility

@westonplatter
westonplatter / HomeController.js
Created November 20, 2013 07:16
stream MP3 through SailsJS framework
/**
* HomeController
*
* @module :: Controller
* @description :: Contains logic for handling requests.
*/
module.exports = {
index: function (req,res) {
@jrideout
jrideout / README.md
Created October 29, 2013 19:11 — forked from mbostock/.block

A quick visual reference to every ColorBrewer scale; colors by Cynthia Brewer. Available in CSS and JS format. Click on a palette to log the constituent colors in hexadecimal RGB to the console.

@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet