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.
Years of being wished for, finally granted!
// | |
// @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. |
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
/** | |
* 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'); | |
} | |
/** |
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.
Years of being wished for, finally granted!
-moz-appearance
to none
. This will "reset" the styling of the element;text-indent
to 0.01px
. This will "push" the text a tiny bit[1] to the right;require 'facter' | |
Facter.add(:tw_cli) do | |
confine :kernel => "Linux" | |
setcode do | |
Facter::Util::Resolution.which('tw_cli') | |
end | |
end |
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) |
$.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: |
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |