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 | |
# Convert non-destructive format(PNG/BMP/TIFF) images to JPEG | |
# (for Windows, runs on git bash only) | |
# | |
# Requires ImageMagick: set correct ImageMagick path as below | |
# (e.g. convert.exe collides with Windows system command) | |
IM_PATH = 'C:/usr/ImageMagick' | |
IM_CONVERT = "#{IM_PATH}/convert" |
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
doctype | |
html | |
head | |
meta(charset="UTF-8") | |
script(src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.17/angular.min.js") | |
body | |
div(ng-app,ng-init="qty=1;cost=2") | |
b Invoice: | |
div Quantity: | |
input(type="number", ng-model="qty") |
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
<!-- Latest compiled and minified CSS --> | |
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
<!-- Optional theme --> | |
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"> | |
<!-- Latest compiled and minified JavaScript --> | |
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> |
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
Accept-Encoding: gzip, deflate |
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 Rack::ETag | |
use Rack::Deflater | |
use Rack::Static, urls: [''], root: 'public', index: 'index.html' | |
run lambda {|env|} # run proc {|env|} も可 |
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
This is *emphasized* |
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 'set' | |
require 'mathn' | |
module Alphametics | |
def solve(puzzle) | |
puzzle = puzzle.upcase | |
words = puzzle.scan /[A-Z]+/ | |
chars = Set.new words.join.each_char | |
abort 'Too many letters' if chars.size > 10 | |
first_chars = Set.new words.select {|w| w.size > 1 }.map {|w| w[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
a = for x in [0..5] | |
x * x | |
console.log a # => [ 0, 1, 4, 9, 16, 25 ] | |
b = while a.length > 0 | |
a.pop() | |
console.log b # => [ 25, 16, 9, 4, 1, 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
source 'https://rubygems.org' | |
ruby 2.0.0 | |
gem 'rack' |
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
run Rack::Directory.new '.' |