Skip to content

Instantly share code, notes, and snippets.

View adz's full-sized avatar

Adam Davies adz

  • Veridapt
  • Adelaide, Australia
  • 04:09 (UTC +09:30)
  • X @adzdavies28
View GitHub Profile
@adz
adz / 0_reuse_code.js
Created September 19, 2016 02:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
Newsletter
Join the Adelaide.rb here!!! https://adelaide-rb-join.herokuapp.com/Jobs
Rails Camp Adelaide tickets here!!! https://ti.to/ruby-australia/rails-camp-adelaide-2016/en
JOBS!
The following companies are looking for developers.
@adz
adz / Favourite RubyConf16 Talks.md
Last active February 14, 2016 22:58
Favourite RubyConf16 Talks
command_builder = rom.command # no relation given, so get builder
nested_command = command_builder.create(user: :users) do |user|
user.create(:books)
end
# equivalent:
nested_command = rom.command({user: :users}, [:create, [:books, [:create]]])
# equivalent
General discussion...
Chris:
meetups allows annnouncements to twitter/FB
need to setup?
Lauren:
-> More general social event? ED/Lauren working on over new years
Lauren:
make_user role name password =
<some code that actually makes user>
make_admin = make_user “admin”
make_admin “adz” “pa$$word”
def make_user(role, name, password)
<some code that actually makes user>
end
class UserMaker
def initialize(role)
@role = role
end
def make(name, password)
@adz
adz / make_user.js
Last active November 27, 2015 04:57
function make_user(role, name, password) {
<some code that actually makes user>
}
//function make_user_with_role(role) {
// function make_user_for_given_role(name, password) {
// make_user(role, name, password)
// }
// return make_user_for_given_role;
# get contents of conf dir
- shell: ls -1 {{ nginx_conf_dir }}/*.conf
register: contents
when: nginx_sites
# so we can delete the ones we don't manage
- name: empty old confs
file: path="{{ item }}" state=absent
with_items: contents.stdout_lines
when: nginx_sites and item not in nginx_confs
@adz
adz / anima_vs_virtus_vs_contracts_vs_noop.rb
Last active September 24, 2015 14:04 — forked from solnic/anima_vs_virtus.rb
Anima + Transproc vs Virtus
require 'anima'
require 'transproc'
require 'contracts'
require 'virtus'
require 'benchmark/ips'
USERS = 1000.times.map { |i| { id: "#{i+1}", name: "User #{i+1}", age: "#{(i+1)*2}" } }