Skip to content

Instantly share code, notes, and snippets.

@tanb
tanb / xhyve-freebsd-tutorial-1.md
Last active November 27, 2021 13:07
FreeBSD running on xhyve tutorial. (Appendix: Resize image with qemu. Create FreeBSD VM with qemu).

TL;DR

  • Create 5GB FreeBSD image.
  • Install FreeBSD on xhyve.
  • Mount host directory.

Requisites

# Node-WebKit CheatSheet
# Download: https://github.com/rogerwang/node-webkit#downloads
# Old Versions: https://github.com/rogerwang/node-webkit/wiki/Downloads-of-old-versions
# Wiki: https://github.com/rogerwang/node-webkit/wiki
# How: https://github.com/rogerwang/node-webkit/wiki/How-node.js-is-integrated-with-chromium
# 1. Run your application.
# https://github.com/rogerwang/node-webkit/wiki/How-to-run-apps
@stubotnik
stubotnik / z-indexes.scss
Created July 11, 2012 13:13
Manage complex z-index layouts with SASS variables
$pages-z-index: 1;
$menu-z-index: $pages-z-index - 1;
$betcard-mask-z-index: $pages-z-index + 1;
$betcard-z-index: $betcard-mask-z-index + 1;
$header-z-index: $betcard-z-index + 1;
$alert-dialog-z-index: $header-z-index + 1;
$betcard-delay-z-index: $alert-dialog-z-index + 1;
$ajax-blocker-z-index: $betcard-delay-z-index;
@grantr
grantr / gist:1105416
Created July 25, 2011 22:31
Chef mysql master/slave recipes
## mysql::master
ruby_block "store_mysql_master_status" do
block do
node.set[:mysql][:master] = true
m = Mysql.new("localhost", "root", node[:mysql][:server_root_password])
m.query("show master status") do |row|
row.each_hash do |h|
node.set[:mysql][:master_file] = h['File']
node.set[:mysql][:master_position] = h['Position']
end
@karthick18
karthick18 / brk_cow.c
Created June 17, 2011 23:08
Just an example to remind that its futile to free memory in the child to avoid taking a break COW perf. hit. Check the header comments for more details.
/*
* Just an example to remind that its futile to free memory in the child
* allocated by the parent to avoid taking a break COW perf. hit.
* Makes sense only to free large chunk sizes in the child. Smaller chunk sizes
* aren't really trimmed by malloc and only end up causing perf hits with
* break COW pages (copy on write) when freeing in the child.
* A break COW is when free results in malloc lib. touching the freed chunk
* of memory resulting in a write protection page fault for the child that ends up
* unmapping the shared page table entry and then maps a writable page copy to the child.
* The net effect for RSS(resident set size) is the same as in the parent but
@czottmann
czottmann / Procfile
Created June 15, 2011 13:43
Example of a Foreman/Capistrano/upstart setup
worker: QUEUE=* bundle exec rake environment resque:work
scheduler: bundle exec rake environment resque:scheduler
@nathany
nathany / deploy.rb
Created March 7, 2011 03:51
Vagrant deploy.rb for Sprinkle using Capistrano delivery method
set :user, 'vagrant'
set :run_method, :sudo
role :app, '33.33.33.10'
ssh_options[:keys] = `vagrant ssh_config | grep IdentityFile`.split.last
@adammiller
adammiller / douglasPeucker.js
Created February 14, 2011 16:54
Javascript implementation of the Douglas Peucker path simplification algorithm
var simplifyPath = function( points, tolerance ) {
// helper classes
var Vector = function( x, y ) {
this.x = x;
this.y = y;
};
var Line = function( p1, p2 ) {
this.p1 = p1;
@mbbx6spp
mbbx6spp / nodejs.spec
Created October 19, 2010 20:27
RPM spec for Node.js v0.4.2.
%define _base node
Name: %{_base}js
Version: 0.4.2
Release: 1%{?dist}
Summary: Evented I/O for V8 Javascript.
Packager: Susan Potter <susan@managedopensource.com>
Vendor: http://nodejs.org
Group: Development/Libraries
License: MIT License
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')