Skip to content

Instantly share code, notes, and snippets.

View lightyrs's full-sized avatar
🌒
ლ(▀̿̿Ĺ̯̿̿▀̿ლ)

Harris Novick lightyrs

🌒
ლ(▀̿̿Ĺ̯̿̿▀̿ლ)
View GitHub Profile
@lightyrs
lightyrs / aspect-ratio-container.styl
Last active December 3, 2015 05:31 — forked from brianmcallister/maintain-ratio.scss
Sass mixin for a responsive box that maintains an aspect ratio.
aspect-ratio-container($horizontal, $vertical)
height 0
padding-bottom ( $vertical / $horizontal * 100 ) %
@lightyrs
lightyrs / osx-for-hackers.sh
Last active August 31, 2015 14:33 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
# Reserved Strings
#
# Strings which may be used elsewhere in code
undefined
null
# Numeric Strings
#
# Strings which can be interpreted as numeric
@lightyrs
lightyrs / combining-ar-scopes-with-or.md
Last active February 25, 2016 05:55
Incrementally Building the v1/events_controller#index Query

Combining ActiveRecord Scopes with OR [<v5]

This came about while trying to construct an ActiveRecord query.

via http://stackoverflow.com/a/9540911/111363

Note that merge combines WHERE clauses using AND. While ActiveRecord does not currently have the ability to combine relations using OR instead, it is coming in ActiveRecord 5 (https://github.com/rails/rails/commit/9e42cf019f2417473e7dcbfcb885709fa2709f89).

It'll look something like this:

via http://tombroomfield.com/the-upcoming-active-record-or-method-will-clean-up-your-queries/

@lightyrs
lightyrs / passcard.txt
Created May 12, 2015 15:10
passcard proof
Verifying I am +h1 on my passcard. https://onename.com/h1
@lightyrs
lightyrs / keybase.md
Created May 12, 2015 00:52
keybase.md

Keybase proof

I hereby claim:

  • I am lightyrs on github.
  • I am h1 (https://keybase.io/h1) on keybase.
  • I have a public key whose fingerprint is 9A17 4265 5180 52AE 464B 10D4 CD37 16F2 14C2 E724

To claim this, I am signing this object:

@lightyrs
lightyrs / force-utf8.rb
Created March 12, 2015 06:01
really force utf-8 in ruby
line.encode!('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
#!/bin/bash
# Sync Homebrew installations between Macs via Dropbox
#
BREW="/usr/local/bin/brew"
# first get local settings
echo "Reading local settings ..."
rm -f /tmp/brew-sync.*
FIXME:
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
or
ERROR -: Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib provides version 10.0.0
gem uninstall nokogiri libxml-ruby
brew update
brew uninstall libxml2
@lightyrs
lightyrs / ssl_puma.sh
Last active August 29, 2015 14:15 — forked from tadast/ssl_puma.sh
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key