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
;; https://www.4clojure.com/problem/19 | |
(fn [x] (first (reverse x))) | |
;; https://www.4clojure.com/problem/20 | |
(fn [x] (second (reverse x))) | |
(fn [x] (first (rest (reverse x)))) | |
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
https://apis.berkeley.edu/coolclimate/footprint-sandbox?input_location=64021&input_location_mode=1&input_size=0&input_income=1&input_population=836&input_footprint_household_adults=2.5&input_footprint_household_children=0&input_footprint_transportation_num_vehicles=1&input_footprint_transportation_miles1=200&input_footprint_transportation_mpg1=25&input_footprint_transportation_fuel1=1&input_footprint_transportation_publictrans=312&input_footprint_transportation_bus=125&input_footprint_transportation_transit=94&input_footprint_transportation_commuter=62&input_footprint_transportation_intercity=31&input_changed=input_takeaction_take_public_transportation&input_takeaction_take_public_transportation_type=0&input_takeaction_take_public_transportation_miles=20&input_takeaction_take_public_transportation_mpg=25&input_takeaction_take_public_transportation_parking=10&input_takeaction_take_public_transportation_ptfare=10&input_takeaction_take_public_transportation_gco2bus=107&input_takeaction_take_public_transportation |
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
# core | |
gulp = require 'gulp' | |
gutil = require 'gulp-util' | |
# stream utilities | |
gif = require 'gulp-if' | |
path = require 'path' | |
# plugins | |
htmlmin = require 'gulp-minify-html' |
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
-----> Clojure (Leiningen 2) app detected | |
-----> Installing OpenJDK 1.6...done | |
-----> Using cached Leiningen 2.5.1 | |
Writing: lein script | |
-----> Building with Leiningen | |
Running: lein with-profile production compile :all | |
. | |
. | |
. |
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 'open-uri' | |
require 'whois' | |
def domain_status(domain) | |
sleep(1.5) # to prevent throttling, if any |
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
#There are 87 images, use as ruby ragetiem.rb [START] [END] | |
require 'net/http' | |
if !test ?d, "ragetiem" : Dir.mkdir("ragetiem"); Dir.chdir("ragetiem") else Dir.chdir("ragetiem") end | |
(ARGV[0] || 1).upto(ARGV[1] || 87) { |i| puts "Processing #{i}" | |
Net::HTTP.start("www.supercamel.id.au") { |http| img = http.get("/ragetiem/images/" + i.to_s + ".jpg"); open(i.to_s + ".jpg", "wb") { |f| f.write(img.body) } } } |
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
set nocompatible | |
syntax on | |
filetype plugin indent on | |
set encoding=utf-8 | |
set mouse=a | |
set ruler | |
set number | |
set tabstop=2 | |
set shiftwidth=2 | |
set softtabstop=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
# Creates a little histogram of the frequency of words occuring in your string | |
# Usage : ruby word_histogram.rb "Test string, string" | |
a=(ARGV[0].split(/[^\w]/).inject(Hash.new(0)){|h,x|h[x.downcase]+=1;h;}.delete_if{|k,v|k==""}.sort_by{|k,v| k.length}.reverse);a.map{|k,v|puts "=> #{k} ".ljust(a.first[0].size+4)+'*'*v+"\n"} |
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 us define a string sequence as : | |
# S[i] for i > 1 = { | |
# i = 1 : () | |
# i > 1 : (S[1]S[2]S[3]S[4]...S[i-1]) | |
# } | |
# | |
# So, S[1] = (), S[2] = (()) , S[3] = (()(())) ... | |
# In this problem, given I, k and m , you are to find the characters in S[I] |
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
Window { | |
"Rectangle": [ | |
{ "Top": "200" }, | |
{ "Bottom": "200" }, | |
{ "Right": "100" }, | |
{ "Left": "100" } | |
] | |
"Title": "About Raiku", | |
"Flags": [ | |
{ "name": "B_NOT_RESIZABLE" }, |
OlderNewer