Skip to content

Instantly share code, notes, and snippets.

---
resources:
- name: postgres
type: docker-image
source:
repository: postgres
tag: 9.6.2-alpine
- name: ruby
type: docker-image
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 40 2 46 47 49 64 62 63 1
sort_key=64
sort_direction=1
hide_threads=0
hide_kernel_threads=1
hide_userland_threads=0
shadow_other_users=0
show_thread_names=0
@luxflux
luxflux / lala.php
Last active September 2, 2015 12:26
$cmd = $_CONF['rndc'] . " reload > /dev/null";
system($cmd, $exit);
if ($exit != 0) { die($_CONF['rndc'] . " exit status " . $exit); }
$cmd = '/root/master2slave.sh';
system($cmd, $exit);
if ($exit != 0) { die($_CONF['rndc'] . " exit status " . $exit); }
@luxflux
luxflux / clone.rb
Last active September 1, 2015 18:57
ASD = { nested: { a: nil } }
# => {:nested=>{:a=>nil}}
b = ASD.clone
# => {:nested=>{:a=>nil}}
b[:nested][:a] = 'asd'
# => "asd"
b
# => {:nested=>{:a=>"asd"}}
ASD
# => {:nested=>{:a=>"asd"}}
require 'rom-mapper'
require 'pp'
input = {
a: {
b: {},
c: {
d: [
{
something: {
class MappingTest
MAPPING = {
passengers: ->(hash) { hash[:customer_info][:person_name] },
flight_ticket_selling_carrier: :extract_services,
}
def results
response = api_call
res = {}
MAPPING.each do |attribute, extraction|
AllCops:
Include:
- "**/*.gemspec"
- "**/*.podspec"
- "**/*.jbuilder"
- "**/*.rake"
- "**/*.opal"
- "**/Gemfile"
- "**/Rakefile"
- "**/Capfile"
if Rails.env.production?
InfluxDB::Rails.configure do |config|
config.async = true
config.instrumentation_enabled = false
end
ActiveSupport::Notifications.subscribe 'process_action.action_controller' do |name, started, finished, unique_id, payload|
log = {
http_status: payload[:status],
uri: payload[:path],
node default {
yumrepo { "epel": enabled => 1 }
Package { require => Yumrepo['epel'] }
openvpn::server { 'winterthur':
country => 'CH',
province => 'ZH',
city => 'Winterthur',
organization => 'example.org',
email => 'root@example.org',
@luxflux
luxflux / .sVimrc
Last active August 29, 2015 14:10
map j scrollDown
map k scrollUp
map h scrollLeft
map l scrollRight