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
require 'digest' | |
require 'forwardable' | |
module CompStat | |
SAMPLE_SIZE = 92 #128 | |
FIELD_SPLIT = "\t\t" | |
class File |
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
#!/usr/bin/env bash | |
# author: Florian Staudacher | |
### | |
# Usage: | |
# ./start.sh | |
# uses the configured base image, creates an overlay (if set) and starts | |
# the VM. The overlay will be discarded at the end (you will have the | |
# possibility to make a copy before it is deleted). | |
# |
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
#!/usr/bin/env sh | |
########################################################################### | |
# CONFIGURATION | |
## | |
TAP_DEV="tap0" # TAP device configured to connect to the remote server | |
ETH_DEV="eth0" # ETH device for DHCP |
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
//# app/assets/javascripts/app/models/post/interactions.js | |
reshare : function(){ | |
var interactions = this | |
, reshare = this.post.reshare() | |
, flash = new Diaspora.Widgets.FlashMessages(); | |
reshare.save() | |
.done(function(){ | |
flash.render({ |
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/bash -xEe | |
# original source: http://blog.ionelmc.ro/2013/05/30/mysql-too-slow-in-tests-ramdisk-it/ | |
# invocation : | |
# ./mysql_ramdisk.sh 1 512M some_user some_password | |
# | |
random_pass=$(ruby -e "print [*'a'..'z', *'A'..'Z', *'0'..'9'].shuffle.first(8).join") | |
i=$1 | |
mem=${2:-350M} |
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 | |
/** | |
* Sperrzeiten JSON API Example | |
* | |
* @author Florian Staudacher, 2015 | |
* <[email protected]> | |
*/ | |
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
require 'resolv' | |
require 'net/http' | |
class ConnectionTester | |
REQUEST_OPTS = { | |
open_timeout: 3, | |
ssl_timeout: 3, | |
read_timeout: 5 |
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
count = Pod.arel_table[:host].count.as("dup_count") | |
col = Arel::Nodes::SqlLiteral.new("dup_count") | |
Pod. | |
group(Pod.arel_table[:host]). | |
having(col.gt(1)).order(col.desc). | |
pluck(count.to_sql, :host). | |
each do |pod| | |
pp pod | |
end |
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
/** | |
* author: Florian Staudacher, 2016 | |
* | |
* ----------------------------------------------------------------------------- | |
* "THE BEER-WARE LICENSE" (Revision 42): | |
* <[email protected]> wrote this file. As long as you retain this | |
* notice you can do whatever you want with this stuff. If we meet some day, and | |
* you think this stuff is worth it, you can buy me a beer in return. | |
* ----------------------------------------------------------------------------- |
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
extern crate futures; | |
extern crate tokio_core; | |
use futures::{Future, Poll, Async}; | |
use futures::stream::Stream; | |
use tokio_core::reactor::Core; | |
struct SendNotice; | |
impl Stream for SendNotice { |