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. |
| /** | |
| * 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 | |
| }; |
| 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) |
| require 'facter' | |
| Facter.add(:tw_cli) do | |
| confine :kernel => "Linux" | |
| setcode do | |
| Facter::Util::Resolution.which('tw_cli') | |
| end | |
| end |
| module.exports = { | |
| extends: [ | |
| "strict", | |
| "prettier", | |
| ], | |
| parserOptions: { | |
| ecmaVersion: 2016, | |
| }, | |
| plugins: ["prettier"], | |
| rules: { |
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!
| # 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 |
| $.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: |