Skip to content

Instantly share code, notes, and snippets.

James Harton jimsynz

Block or report user

Report or block jimsynz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jimsynz
jimsynz / install_ex.sh
Last active Nov 4, 2018
I use this to install Elixir on Codeship.
View install_ex.sh
#!/bin/sh
# I use this to install Elixir on our codeship instances for testing. YMMV.
# curl -O https://gist.githubusercontent.com/jamesotron/44f8962cddef781ab830/raw/e75599e95587cbca26e707505fd40dd0f26eb0f5/install_ex.sh
# . ~/install_ex.sh
# You can override your Elixir and Erlang versions from your shell when you call ./install_ex.sh.
export ERLANG_VERSION=${ERLANG_VERSION:-18.0.3}
export ELIXIR_VERSION=${ELIXIR_VERSION:-1.0.5}
@jimsynz
jimsynz / enumerable_skip.rb
Last active Aug 29, 2015
Duck punch `skip` into `Enumerable` because it should have it.
View enumerable_skip.rb
module Enumerable
# Duck punch for Enumerable that adds skip() to bypass
# the first `n` elements of the enumerator.
# Use skip/take to retrieve a range of values from an enumerable
# without forcing the values into an array and using [].
#
# This is substantially faster for really big collections, but
# not so much for small ones. ie use at your own risk
# Also, skip provides superficially the same behaviour as drop,
View Dnsmasq conf for railscamp
# Never forward addresses in the non-routed address spaces.
bogus-priv
# Filter useless windows-originated DNS requests.
filterwin2k
# Drop privileges from root to this user and group.
user=dnsmasq
group=nogroup
# By default, dnsmasq binds the wildcard address, even when only listening on
@jimsynz
jimsynz / auto_confirm.patch
Created Jan 10, 2015
Patches for the RailsCamp GitLab Vagrant box.
View auto_confirm.patch
--- user.rb.orig 2015-01-10 20:53:40.369172619 +0000
+++ user.rb 2015-01-10 19:16:38.650782073 +0000
@@ -180,6 +180,8 @@
scope :without_projects, -> { where('id NOT IN (SELECT DISTINCT(user_id) FROM members)') }
scope :potential_team_members, ->(team) { team.members.any? ? active.not_in_team(team) : active }
+ after_create :confirm!
+
#
# Class methods
View gem mirror output
Fetching: https://rubygems.org/specs.4.8.gz
Total gems: 505858
Fetching 94 gems
....404 on application_seeds-0.1.0.gem
......404 on dwradcliffe_test_gem_push-0.0.4.gem
....404 on good-0.1.2.gem
.........404 on filelock-1.0.2.gem
..................404 on picasawebalbums-1.4.6.gem
.....................................................Deleting 0 gems
View assets_helper.rb
module AssetsHelper
def inline_asset name
Rails.application.assets.find_asset(name).source
end
end
View gtk-pixbuf_build_log.txt
[08:27][jnh@Bucket]~$ brew upgrade -v gdk-pixbuf
==> Upgrading 1 outdated package, with result:
gdk-pixbuf 2.30.8
==> Upgrading gdk-pixbuf
rm /usr/local/bin/gdk-pixbuf-csource
rm /usr/local/bin/gdk-pixbuf-pixdata
rm /usr/local/bin/gdk-pixbuf-query-loaders
rm /usr/local/include/gdk-pixbuf-2.0
rm /usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ani.la
rm /usr/local/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ani.so
@jimsynz
jimsynz / kstruct.rb
Created Aug 25, 2014
Struct using keyword args (actually, really just a hash).
View kstruct.rb
class KStruct
def self.new *attr_names
Class.new(Struct) do
attr_accessor *attr_names
end
end
class Struct
def initialize args
View object.chuia
!RBIX
3820501463222725467
0
M
1
n
n
n
i
19
View scope.rb
def bytecode g
pos g
g.push_rubinius
g.create_block block_from_children g
g.send_stack_with_block :lambda, 0
g.ret
end
You can’t perform that action at this time.