Skip to content

Instantly share code, notes, and snippets.

View mindreframer's full-sized avatar
🎯
Focusing

Roman Heinrich mindreframer

🎯
Focusing
View GitHub Profile
~ # redis-benchmark -s /var/run/redis/redis.sock -q -n 10000
PING_INLINE: 156250.00 requests per second
PING_BULK: 196078.44 requests per second
SET: 212765.97 requests per second
GET: 185185.19 requests per second
INCR: 217391.30 requests per second
LPUSH: 200000.00 requests per second
LPOP: 222222.22 requests per second
SADD: 204081.64 requests per second
SPOP: 217391.30 requests per second
function makeStyle(defaults, tagName) {
tagName = tagName || 'div';
var Style = React.createClass({
getDefaultProps: function() {
return assign({}, defaults);
},
render: function() {
var style = assign({}, this.props);
delete style.children;
@TheSeamau5
TheSeamau5 / csslayout.elm
Created January 31, 2015 17:48
Wrapping CSS Layout in Elm
type alias Bounds = {
left : Float,
right : Float,
top : Float,
bottom : Float
}
bounds : Bounds
bounds = Bounds 0 0 0 0
@tokumine
tokumine / hetzner
Created February 2, 2012 15:06
Hetzner EX 4S Unixbench, dd and htparm results
The Unixbench results for the Hetzner EX 4S servers recently featured on HackerNews. (dd and htparm tests at the bottom)
- http://news.ycombinator.com/item?id=3537513
- http://www.hetzner.de/en/hosting/produkte_rootserver/ex4s
To compare with AWS, see the Unixbench results from: http://blog.cloudharmony.com/2010/05/what-is-ecu-cpu-benchmarking-in-cloud.html
TLDR; the €59/mo EX 4S scores higher (1729) than AWS m2.4xlarge (1511) on single threaded loads.
Postscript
class Enum < Hash
def initialize(*members)
super()
@rev = {}
members.each_with_index {|m,i| self[i] = m }
end
def [](k)
super || @rev[k] # || raise ArgumentError, "#{k} is not a member of this enum"
end
def []=(k,v)
@idibidiart
idibidiart / GraphQL-Relay-HN.md
Last active February 16, 2016 02:21
GraphQL/Relay
// devDependencies in package.json:
"require-reload": "0.2.2",
"react-transform-hmr-no-accept": "1.0.1", // not published, get it here: https://github.com/brandonbloom/react-transform-hmr
// in babelrc:
"env": {
"development": {
"plugins": [
@rob-brown
rob-brown / stage_inspector.ex
Last active August 18, 2016 07:06
Inspect the data passed between GenStages.
defmodule StageInspector do
alias Experimental.{GenStage}
use GenStage
def init(type) when type in [:consumer, :producer_consumer] do
{type, type}
end
def handle_events(events, _from, state = :consumer) do
Enum.each events, &inspect_event/1
@cloudbring
cloudbring / README.md
Last active May 1, 2017 02:42
Building an Phoenix / Elixir Web App in June 2015
@jlongster
jlongster / forms-with-react.js
Last active May 8, 2017 14:15
higher-order form components w/react
// Simple wrapper to use bootstrap's grid system to position elements side-by-side
var VerticalFieldsElement = React.createClass({
render: function() {
return dom.div(
{ className: 'clearfix' },
React.Children.map(this.props.children, function(child) {
if(!child) {
return child;
}