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
plot = Plot[Cos[x],{x,0,2\[Pi]}]; | |
mydata = Flatten[Cases[plot, Line[x__] -> x, Infinity], 1]; | |
Export["/Users/padde/Desktop/plot-data.dat", mydata, "CSV"]; |
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
tty = STDIN.reopen('/dev/tty') | |
tty.each_line do |line| | |
break if line == "\n" | |
puts line | |
end | |
tty.close |
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
<?xml version="1.0" encoding="utf-8"?> | |
<item name="a"> | |
<item name="d"> | |
<item name="g"></item> | |
</item> | |
<item name="e"></item> | |
<item name="f"></item> | |
</item> | |
<item name="b"></item> | |
<item name="c"></item> |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/3112090/hack.sh | sh | |
# |
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
@interface NSData (CRC32) | |
-(NSUInteger) crc32; | |
@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
TMPFILE=".$(uuidgen).tmp.rb" | |
cat > $TMPFILE <<RUBYSCRIPT | |
# TODO: replace this with real code | |
puts "Running Ruby #{RUBY_VERSION}" | |
puts "Arguments are #{ARGV.inspect}" | |
RUBYSCRIPT | |
/usr/bin/env ruby $TMPFILE "{query}" | |
rm $TMPFILE |
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
require 'fuzzy_match' | |
require 'amatch' | |
require 'text' | |
class Completion | |
attr_accessor :keywords | |
def initialize( keywords=[] ) | |
self.keywords = keywords.map(&:downcase) | |
ambiguous = true |
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 | |
require 'securerandom' | |
require 'fileutils' | |
require 'coderay' | |
require 'coderay_bash' | |
require 'trollop' | |
opts = Trollop::options do | |
opt :language, "The language used to highlight the input", short: '-l', type: :string, default: nil |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>Test</title> | |
{% seo %} | |
{% inline_editor %} | |
</head> | |
<body> | |
<nav id="main_menu"> |
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
class Array | |
class EachDSL | |
attr_accessor :idx, :max | |
def initialize arr | |
self.max = arr.size | |
end | |
def pos | |
idx + 1 |