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
listofemails = new File("email_list.txt").text | |
listofemails.eachLine { it -> | |
def respons = new XmlSlurper().parseText(new URL("http://www.stopforumspam.com/api?email=${it}").text) | |
if (respons.appears.text() == "yes") { | |
println "${it} has been reported ${respons.frequency.text()} times on stopforumspam.com" | |
} | |
} |
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
image: amscotti/jekyll-build | |
pipelines: | |
default: | |
- step: | |
script: | |
- bundle exec jekyll build | |
branches: | |
master: | |
- step: |
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
FROM alpine:3.2 | |
MAINTAINER Anthony Scotti <anthony.m.scotti@gmail.com> | |
# Install base packages | |
RUN apk update | |
RUN apk upgrade | |
RUN apk add curl tar ca-certificates bash build-base libffi-dev | |
RUN curl -Ls https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.21-r2/glibc-2.21-r2.apk > /tmp/glibc-2.21-r2.apk | |
RUN apk add --allow-untrusted /tmp/glibc-2.21-r2.apk |
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
hello = fn(text) -> | |
fn(name) -> | |
"#{text} #{name}" | |
end | |
end.("Hello") | |
IO.inspect hello.("World") # "Hello World" |
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
IO.inspect Enum.reduce(Enum.filter(1..999,fn(x) -> rem(x, 3) == 0 || rem(x, 5) == 0 end), 0, &1+&2) |
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
defmodule Factorial do | |
def of(0), do: 1 | |
def of(n), do: n * of(n-1) | |
end | |
IO.inspect Factorial.of(4) |
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
divisible = 3 | |
divisibleReporter = (lastFound, nextDivisible) -> | |
"Found: #{lastFound}, Next: #{nextDivisible}" | |
divisibleKeeper = ((divisible) -> | |
lastFound = 0 | |
nextDivisible = divisible | |
(number) -> | |
if (number >= nextDivisible) |
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 Character | |
@name | |
constructor: (person, @role) -> | |
@name = "#{person.firstname} #{person.lastname}" | |
toString: () -> | |
"#{@role} played by #{@name}" | |
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
@Grab(group='org.ccil.cowan.tagsoup', module='tagsoup', version='1.2' ) | |
def tagsoupParser = new org.ccil.cowan.tagsoup.Parser() | |
def slurper = new XmlSlurper(tagsoupParser) | |
def url = "http://www.nfl.com/stats/categorystats?archive=false&conference=null&statisticCategory=PASSING&season=2010&seasonType=REG&experience=null&tabSeq=0&qualified=true&Submit=Go" | |
def htmlParser = slurper.parse(url) | |
tabledata = htmlParser.'**'.find { it.@class == 'data-table1' }.tbody.tr.collect { | |
[ | |
Rk: it.td[0].text().trim(), | |
Player: it.td[1].text().trim(), |
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/local/bin/python | |
#Used to make snapshot of all the file systems on a zpool. | |
import commands | |
import subprocess | |
import time | |
import os | |
timestamp = time.strftime("%Y%m%d-%H%M") |