Navigation Menu

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.
@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@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');
}
/**
@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!

@joaocunha
joaocunha / How To Hide The Select Arrow On Firefox.md
Last active December 10, 2023 13:05
How to hide <select> dropdown's arrow in Firefox when using "-moz-appearance: none;".

This is no longer a bug. I'm keeping the gist for historical reasons, as it helped to get it fixed. Make sure to read the notes by the end of the post.

How to remove hide the select arrow in Firefox using -moz-appearance:none;

TL;DR (or, the fix)

  1. Set -moz-appearance to none. This will "reset" the styling of the element;
  2. Set text-indent to 0.01px. This will "push" the text a tiny bit[1] to the right;
@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
@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)
@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:
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/