Skip to content

Instantly share code, notes, and snippets.

View sorahn's full-sized avatar
🎩

Daryl Roberts sorahn

🎩
  • Tovia, LLC
  • Atlanta
View GitHub Profile
@sorahn
sorahn / side-shadow.scss
Last active August 29, 2015 14:16
Generate an "inset" shadow on a single side of a div.
//
// @author Daryl Roberts
// @license MIT
// @url https://gist.github.com/sorahn/7915cae6c820e351158f
//
@mixin side-shadow($shadow, $side, $base-size: 50px) {
// If you need to make shadows larger than 50px, you can
// override the base size.
@benhuson
benhuson / ios7-safari-height-issue
Last active April 22, 2016 10:10
Fix iOS 7 iPad Safari Landscape innerHeight/outerHeight layout issue
/**
* Add ipad IOS7 Classes
* Allows us to temporariliy try to fix the slight scroll 100% hack.
* http://stackoverflow.com/questions/19012135/ios-7-ipad-safari-landscape-innerheight-outerheight-layout-issue
*/
if (navigator.userAgent.match(/iPad;.*CPU.*OS 7_\d/i)) {
$('html').addClass('ipad ios7');
}
/**
import React from 'react';
import { TransitionSpring, presets } from 'react-motion';
export default class Modal {
static propTypes = {
shown: React.PropTypes.bool,
onClose: React.PropTypes.func
};
@fauxparse
fauxparse / date.coffee
Created December 21, 2011 23:20
CoffeeScript date utilities
Number::pad = (digits, signed) ->
s = Math.abs(@).toString()
s = "0" + s while s.length < digits
(if @ < 0 then "-" else (if signed then "+" else "")) + s
Date.months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]
Date.weekdays = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ]
Date.formats =
"a": -> Date.weekdays[@getDay()].substring(0, 3)
@jhoblitt
jhoblitt / tw.rb
Created June 18, 2013 17:03
Attempting to testing facter facts with rspec
require 'facter'
Facter.add(:tw_cli) do
confine :kernel => "Linux"
setcode do
Facter::Util::Resolution.which('tw_cli')
end
end
@lydell
lydell / .eslintrc.js
Last active September 22, 2017 09:29
Generates .flowconfig regexps that ignores everything in `node_modules/` except the given modules.
module.exports = {
extends: [
"strict",
"prettier",
],
parserOptions: {
ecmaVersion: 2016,
},
plugins: ["prettier"],
rules: {
@aseemk
aseemk / coffeescript-updates.md
Last active December 2, 2017 20:22
CoffeeScript upcoming changes.

CoffeeScript 1.7 is shaping up to be a pretty kick-ass release with significant improvements. Here are the ones I'm most excited about, in order of my own excitement.

Parentheses-free chaining

jashkenas/coffeescript#3263

Years of being wished for, finally granted!

@algesten
algesten / start-tmux.sh
Created May 14, 2017 07:59
start tmux in bashrc
# TMUX
# test if tmux is available
if type tmux >/dev/null 2>&1; then
# if not inside a tmux session, and if no session is started, start a new session
# I only want this on my mac laptop.
if [ -z "$TMUX" -a `uname` == Darwin ]; then
# attach to session "martin" if there
exec tmux -2 -f ~/.tmux-osx.conf new-session -A -s martin
fi
fi
@jimeh
jimeh / jquery.myplugin.coffee
Created April 7, 2011 23:44
Example jQuery plugin written in CoffeeScript, and the resulting compiled JavaScript file.
$.fn.extend
myplugin: (options) ->
self = $.fn.myplugin
opts = $.extend {}, self.default_options, options
$(this).each (i, el) ->
self.init el, opts
self.log el if opts.log
$.extend $.fn.myplugin,
default_options:
@sorahn
sorahn / Laws of Computer Programming.md
Last active September 15, 2023 17:54
COMPUTER© 1980 ART 101 Limited, Atlanta Georgia - Kenneth Grooms

laws of computer programming

  • any given program, when running, is obsolete.
  • if a program is useless, it will have to be documented.
  • if a program is useful, it will have to be changed.
  • any program will expand to fill all available memory.
  • the value of a program is proportional to the weight of its output.
  • program complexity grows until it exceeds the capability of the programmer to maintain it.
  • make it possible for programmers to write in english and you will find that programmers cannot write in english.

rules of pratt