Skip to content

Instantly share code, notes, and snippets.

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

Harris Novick lightyrs

🌒
ლ(▀̿̿Ĺ̯̿̿▀̿ლ)
View GitHub Profile
@lightyrs
lightyrs / favorites.css
Last active March 30, 2017 01:16
Favorite Simple CSS Styles
.subtle-gradient-1 {
background-image: linear-gradient(to right, #f0fcff 0%, #f2f4ff 100%);
}
.pastel-gradient-1 {
background-image: linear-gradient(to left bottom, hsl(253, 100%, 85%) 0%, hsl(132, 100%, 85%) 100%);
}
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@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.*