This file contains 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/share/source-highlight/lang.map.old | |
+++/usr/share/source-highlight/lang.map | |
@@ -169,3 +169,5 @@ | |
groovy = groovy.lang | |
json = json.lang | |
feature = feature.lang | |
+yaml = yaml.lang | |
+yml = yaml.lang |
This file contains 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
. | |
. . | |
. 1 . | |
. 1 1 . | |
. . . . . | |
. 1 . . 1 . | |
. . . . . . . | |
This file contains 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
# reverse polish notation | |
src = "PI 2 / sin 7 * 3 2 ** + abs PI *" | |
stack = [] | |
src.split(" ").each do |tk| | |
case tk | |
when %r{^(\+|\*|\*\*|/)$} | |
lhs = stack.pop | |
rhs = stack.pop | |
stack.push eval("#{lhs} #{tk} #{rhs}") |
This file contains 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 | |
# coding: utf-8 | |
require "json" | |
class OreLang | |
def initialize(source) | |
@source = source | |
@vars = {} | |
end |
This file contains 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
let &makeprg = 'py.test --tb=short -rs -q' | |
if !exists('g:orgerrorformat') | |
let g:orgerrorformat = &errorformat | |
endif | |
" let &errorformat = '' | |
" let &errorformat .= 'SKIP\ %*[^ ]\ %f:%l:\ %m,' | |
" let &errorformat .= g:orgerrorformat |
This file contains 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
" | |
" let &makeprg = 'node_modules/.bin/eslint' | |
" | |
" if !exists('g:orgerrorformat') | |
" let g:orgerrorformat = &errorformat | |
" endif | |
" | |
" let &errorformat = | |
" \ '%E%f: line %l\, col %c\, Error - %m,' . | |
" \ '%W%f: line %l\, col %c\, Warning - %m' |
This file contains 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 | |
## | |
# Copy stdin to clipboard with removing trailing LF char. | |
# | |
# Usage: | |
# $ cat some.file | pbcopytr | |
## | |
require "open3" |
This file contains 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 = True | |
def fetch_global(): | |
print VAR | |
def assign_locally(): | |
VAR = False | |
print VAR | |
def assign_locally_after_printed(): |
This file contains 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
import sys | |
from functools import total_ordering | |
print sys.version | |
class CharacterBase: | |
@classmethod | |
def create(cls, *names): | |
return [cls(n[0], n[1]) for n in names] |
This file contains 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/vtk5.rb 2016-02-23 10:06:50.000000000 +0900 | |
+++ b/vtk5.rb 2016-02-23 10:09:12.000000000 +0900 | |
@@ -27,9 +27,8 @@ | |
depends_on "cmake" => :build | |
depends_on :x11 => :optional | |
depends_on "qt" => :optional | |
- depends_on :python => :recommended | |
- # If --with-qt and --with-python, then we automatically use PyQt, too! | |
- if build.with?("qt") && build.with?("python") | |
+ |