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 "json" | |
json = JSON.parse(IO.read('snippets.json')) | |
json.each do |s| | |
name = s["contents"] | |
prefix = s["trigger"] | |
body = s["contents"] | |
puts name.to_json | |
puts " 'prefix': #{prefix.to_json}" |
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
(* ::Package:: *) | |
BeginPackage["SimpleAssume`"] | |
Unprotect @@ Names["SimpleAssume`*"]; | |
ClearAll @@ Names["SimpleAssume`*"]; | |
$Assumptions={} | |
AssumeReal::usage = "assume variables to be real"; | |
AssumeRealPositive::usage = "assume variables to be real and positive"; |
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 | |
# Calculate the next match for cron conditions (secs). | |
# Numbers > 60 mean the match is in the next minute. | |
# | |
# Arbitrary conditions: | |
# just take the minimum of all the individual ones. | |
# 60 secs / min |
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
# Description: | |
# YO | |
# | |
# Commands: | |
# hubot yo <name> - YO | |
module.exports = (robot) -> | |
robot.respond /YO (\w+)$/i, (msg) -> | |
token = process.env.HUBOT_YO_TOKEN | |
data = "api_token=#{token}&username=#{msg.match[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
### Keybase proof | |
I hereby claim: | |
* I am lucas-clemente on github. | |
* I am lclemente (https://keybase.io/lclemente) on keybase. | |
* I have a public key whose fingerprint is E2A4 476D E63B 0B27 B357 0F26 4273 9281 0E47 693A | |
To claim this, I am signing this object: |
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 -w | |
# Save to pdflatex to ~/bin/pdflatex | |
if ARGV.length == 0 | |
puts "Usage: texify <file.tex> <tex options>" | |
exit 1 | |
end | |
file = ARGV.select{|v| v =~ /.*\.tex/}[0] |
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 -wKU | |
require 'rainbow' | |
def exec_cmd(cmd, ignore_fail = false) | |
puts cmd.bright | |
if !system(cmd, :out => File.open(File::NULL, 'w')) | |
if ignore_fail | |
return 1 | |
else |
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
function rvm -d 'Ruby enVironment Manager' | |
# run RVM and capture the resulting environment | |
set -l env_file (mktemp -t rvm.fish.XXXXXXXXXX) | |
bash -c 'source ~/.rvm/scripts/rvm; rvm "$@"; status=$?; env > "$0"; exit $status' $env_file $argv | |
# apply rvm_* and *PATH variables from the captured environment | |
and eval (grep '^rvm\|^[^=]*PATH' $env_file | sed '/^[^=]*PATH/y/:/ /; s/^/set -xg /; s/=/ /; s/$/ ;/; s/(//; s/)//') | |
# clean up | |
rm -f $env_file |
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
Dir['app/models/*.rb'].map {|f| File.basename(f, '.*').camelize.constantize }.map { |c| {c.name => c.all.select {|f| f.invalid?}.map {|f| f.errors}}} |
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
$Assumptions = {# \[Element] Reals, # > 0} & /@ {m, k, T} // Flatten; |
OlderNewer