Skip to content

Instantly share code, notes, and snippets.

View drench's full-sized avatar

Daniel Rench drench

View GitHub Profile
<?php
// Define the 'class' class
$class = Obj()
->fn('new', function ($class) {
$newClass = Obj($class->methods)
->fn('new', function($class) {
$obj = Obj($class->imethods);
$args = func_get_args();
array_shift($args);
(function() {
// Notes from http://news.ycombinator.com/item?id=1952531
var notes = {
"suspended cymbal":"zk",
"snare":"bschk",
"brush":"pv",
"bass":"bk",
"flam1":"tk",
"roll tap":"vk",
"flam2":"kt",
@zaius
zaius / background.sh
Created January 16, 2011 23:29
How to redirect a running process output to a file and log out
ctrl-z
bg
touch /tmp/stdout
touch /tmp/stderr
gdb -p $!
# In GDB
p dup2(open("/tmp/stdout", 1), 1)
p dup2(open("/tmp/stderr", 1), 2)
@aemkei
aemkei / LICENSE.txt
Last active June 4, 2024 07:51 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@yuroyoro
yuroyoro / attr_inquireable.rb
Last active May 10, 2017 20:35
AttrInquirable wraps value of attribute in ActiveSupport::StringInquirer.
# AttrInquirable
# wraps value of attribute in ActiveSupport::StringInquirer.
#
# Usage:
#
# class Person < ActiveRecord::Base
# attr_inquireable :status
# end
#
# person = Person.new(:status => :pending)
set nocompatible
set viminfo='20,\"500 " Keep a .viminfo file.
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif |
@gsavovski
gsavovski / VimChi - June 25th 2014 - Hashrocket
Last active August 29, 2015 14:02
Unite.vim Talk - VimChi - June 25th 2014 - Hashrocket
Unite.vim
===============================================
These are takeaways from the VimChi talk on Unite.vim.
This gist serves as easy copy paste resource when experimenting
with Unite, so that I can save you from taking notes in
the talk.
For more specific configuration with mapping and such,
you can checkout my .vimrc: github.com/gsavovski/VimplifY
@oneohthree
oneohthree / quick-slugify.sh
Last active February 22, 2024 01:53
Quick bash slugify
echo "$STRING" | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z
@zg
zg / freebsd-qemu-xhyve-mac-os-x-virtual-machine.md
Last active May 25, 2024 19:04
Create FreeBSD virtual machine using qemu. Run the VM using xhyve.

TL;DR

  • Create 10GB FreeBSD image using QEMU.
  • Run the VM using xhyve.
  • Mount host directory.
  • Resize the image.

Requisites

@tatianamac
tatianamac / tatiana-mac-speaker-rider.md
Last active March 24, 2024 12:22
Tatiana Mac's Speaker Rider

Speaker Rider

by Tatiana Mac

Last updated 14 April 2021

What is a speaker rider?

As speaking comes with immense privilege, I have crafted a speaker rider to set expectations and boundaries around my engagement. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most historically excluded and marginalised communities.

Considerations

😫 I provide a lot of explanations for those of you who never had to consider these things. Most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.