This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var TweeningNumber = React.createClass({ | |
| mixins: [tweenState.Mixin], | |
| getInitialProps: function() { | |
| return { | |
| value: 0, | |
| duration: 500 | |
| }; | |
| }, | |
| getInitialState: function() { | |
| return { value: 0 }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Progress | |
| class DefaultFormatter | |
| def progress_format(current, total) | |
| format("\e[K\e[G %5.2f%% (%s / %s)", current / total.to_f * 100.0, format_number(current), format_number(total)) | |
| end | |
| def format_number(number) | |
| number.to_s.chars.reverse.each_slice(3).map(&:reverse).reverse.map(&:join).join(" ") | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM node:latest | |
| MAINTAINER Andreas Alin | |
| ADD package.json /app/package.json | |
| RUN cd /app && npm install | |
| RUN npm install node-sass | |
| COPY . /app | |
| WORKDIR /app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'shellwords' | |
| class Blamify | |
| PORCELAIN_COMMIT_HASH_RE = /^(?<hash>\h{40})\s/ | |
| PORCELAIN_LINE_RE = /^\t(?<line>.*)$/ | |
| COLORS = (237..255).to_a # Greyscale gradient | |
| def initialize(filename) | |
| @filename = filename | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var debugArgsPatch = (object, property) => { | |
| if (typeof object[property] !== 'function') { | |
| throw `Object does not have the function ${property}`; | |
| } | |
| var origFunc = object[property]; | |
| object[property] = (...args) => { | |
| console.log(`Call ${property}:`, args); | |
| var ret = origFunc.apply(object, args); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| filename = ARGV[0] | |
| branch_name = `git rev-parse --abbrev-ref HEAD` | |
| issue = branch_name[/^[A-Z]+-\d+/] | |
| if issue | |
| contents = File.read(filename) | |
| File.write(filename, "#{ issue }:\n#{ contents }") | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Put this in your project root and create a symlink from ~/.tmuxinator/projectname.yml | |
| name: <%= File.basename(path, '.*') %> | |
| root: <%= | |
| begin | |
| File.dirname(File.readlink(path)) | |
| rescue | |
| puts "#{path} should be symlinked from your project root." | |
| exit 1 | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| const fs = require("fs"); | |
| function leftPad(str, length, chr) { | |
| str = str.toString(); | |
| if (str.length >= length) { | |
| return str; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'shellwords' | |
| FIELDS = %w(artist album name duration spotify\ url).map { |x| "#{x} of current track" }.join(' & "\\n" & ') | |
| SCRIPT =<<EOF | |
| tell application "Spotify" | |
| #{FIELDS} | |
| end tell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'io/console' | |
| require 'pp' | |
| files = Dir["*"].sort | |
| MAX_COLUMNS = 9 | |
| MAX_COLUMNS.downto(1) do |i| | |
| columns = files.each_slice(i).map { |x| Array.new(i) { |n| x[n] } } | |
| rows = columns.transpose |