Skip to content

Instantly share code, notes, and snippets.

# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports = [
./hardware-configuration.nix
];
var UserAdder = React.createClass({
getInitialState: function() {
return {name: ''}
},
changeHandler: function(e) {
this.setState({name: e.target.value});
},
appendUser: function() {
this.props.callback(this.state.name);
},
@Ortuna
Ortuna / Example.rb
Last active August 29, 2015 14:07
Example Gist
This is an example

Keybase proof

I hereby claim:

  • I am ortuna on github.
  • I am ortuna (https://keybase.io/ortuna) on keybase.
  • I have a public key whose fingerprint is 9784 306F 8754 CEAC D8C6 BEB8 8C79 50F4 2CF3 4669

To claim this, I am signing this object:

@Ortuna
Ortuna / screen-rotate.sh
Created July 6, 2014 13:33
Lenovo Yoga 11s Screen rotation
#!/bin/bash
rotation=$(xrandr -q --verbose|grep eDP1 |grep -oh ") .* (" | grep -o "\w.*\w")
if [ $rotation = 'normal' ]
then
xrandr -o right
elif [ $rotation = 'right' ]
then
xrandr -o inverted
elif [ $rotation = 'inverted' ]
set nocompatible " be iMproved set re=2
filetype off " required!
set shell=bash
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'vbundles/nerdtree'
Bundle 'vbundles/ctrlp'
module Where
class <<self
attr_accessor :editor
def is_proc(proc)
source_location(proc)
end
def is_method(klass, method_name)
source_location(klass.method(method_name))
@Ortuna
Ortuna / blog.rb
Last active December 11, 2015 18:09
class Blog < Padrino::Application
layout :application
get :index do
test_hash = { :a => 1, :b => 2, :c => 3 }
render test_hash
end
end
@Ortuna
Ortuna / dnsd.rb
Created October 8, 2012 22:46 — forked from peterc/dnsd.rb
Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations)
# By Peter Cooper
#
# MIT license
#
# * Not advised to use in your production environment! ;-)
# * Requires Ruby 1.9
# * Supports A and CNAME records
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance
# * All records get the same TTL
@Ortuna
Ortuna / import_events.php
Created September 28, 2012 18:32
Quick and dirty import into CiviCRM from a webcrawl
<?php
define('SOURCE', '[redacted]');
define('DRUPAL_ROOT', '.');
define('IMPORT_LOCATION_MAIN', 3);
define('IMPORT_WEBSITE_MAIN', 6);
define('IMPORT_PHONE_MOBILE', 2);
define('IMPORT_PHONE_FAX', 3);
$stdout = fopen('php://stdout', 'w');