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
find . -name '*.sln' > solutions.txt | |
while read line; do | |
name=`basename "$line"`; | |
grep '^Project.*\.csproj' "$line" | | |
awk -F'=' '{print $2}' | | |
awk -F',' -v sln="$name" '{print sln "," $1 "," $2}' ; | |
done < solutions.txt > solutionsAndProjects.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
fizzbuzz x | |
| x `mod` 3 == 0 && x `mod` 5 == 0 = "fizzbuzz" | |
| x `mod` 3 == 0 = "fizz" | |
| x `mod` 5 == 0 = "buzz" | |
| otherwise = show x | |
fizzbuzz100 = | |
mapM_ putStrLn [ fizzbuzz x | x <- [1..100] ] |
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
def myJob = hudson.model.Hudson.instance.getItem("My_Job") | |
def lastBuild = myJob.getLastBuild() | |
def cause = lastBuild.getCause(hudson.model.Cause$UpstreamCause) | |
def parentBuildNum = cause.upstreamBuild | |
def parentJobName = cause.upstreamProject | |
def parentJobUrl = cause.upstreamUrl | |
println(parentBuildNum) | |
println(parentJobName) | |
println(parentJobUrl) |
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
for f in `ls -d *faces`; do ls $f/*.cs ; done > interfaces_servicios.txt | |
while read line; do | |
grep -e '.*(.*);' $line | sed -e 's/^ *//g' -e 's/;//g'| | |
awk -v file=$line '{ | |
idxMethod=index($0," ")+1; | |
idxArgs=index($0,"("); | |
print file"|"$1"|"substr($0,idxMethod,idxArgs-idxMethod)"|"substr($0,idxArgs) | |
}'; done < interfaces_servicios.txt > servicios_medtzin.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
require 'erb' | |
template = ERB.new <<-EOF | |
This is a greeting to <%= name %>. | |
EOF | |
File.readlines('names.txt').each do |line| | |
name = line.chomp | |
puts template.result(binding) | |
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
(:use 'seesaw.core) | |
(def lbl (label "Swing App in Clojure/Seesaw")) | |
(def btn (button :text "Click me")) | |
(listen btn :action (fn [e] (config! lbl :text "You clicked me!" ))) | |
(frame :title "Hello Swing in Clojure", | |
:content (border-panel | |
:center btn | |
:south lbl |
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 'fileutils' | |
require 'erb' | |
template = ERB.new <<-EOF | |
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'<%= sp_name %>') AND type in (N'P', N'PC')) | |
DROP PROCEDURE <%= sp_name %> | |
GO | |
EOF |
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
# "Executive" summary | |
git log --author="Agustin Ramos" --since="6am" --pretty=oneline | |
# With stats | |
git log --author="Agustin Ramos" --since="6am" --pretty=oneline --stat | |
# With timestamps |
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 'I18n' | |
I18n.transliterate("Agustín") == "Agustin" # => true | |
I18n.transliterate("año") == "ano" # => true | |
I18n.transliterate("güero") == "guero" # => 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
import Window | |
import Graphics.Collage | |
iterations = 8 | |
middle (x,y) (x',y') = ((x + x') / 2, (y + y') / 2) | |
set n idx [p1, p2, p3] = | |
let [a,b,c] = [middle p1 p2, middle p2 p3, middle p1 p3] | |
subTriangles = [ |
OlderNewer