#ThinkDSP 文件版本 0.10.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
brew install go | |
export GOPATH=$HOME/golang | |
export GOROOT=/usr/local/opt/go/libexec | |
export PATH=$PATH:$GOPATH/bin | |
export PATH=$PATH:$GOROOT/bin | |
GO15VENDOREXPERIMENT=1 go get github.com/prometheus/prometheus/cmd/... | |
prometheus -config.file=prometheus.yml |
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
on run {input, parameters} | |
set inputVolume to input volume of (get volume settings) | |
set curVolume to (get volume settings) | |
if (inputVolume = 0 and (output muted of curVolume is false)) then | |
set inputVolume to 100 | |
set volume with output muted | |
set displayNotification to "Microphone on, speakers off" | |
else if (inputVolume > 0 and (output muted of curVolume is true)) then |
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 |
The basic premise behind this has started here: https://github.com/kitallis/cacophonica. It's basically broken down into three parts:
- Detect the pitch / frequency from the instrument / input.
- Build a system that allows representing music as data from ground up (https://github.com/kitallis/cacophonica/blob/master/src/cacophonica/melodic/src/melodic/core.clj)
- Build a system that matches 1 against 2.
Read below for more details.
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
# 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
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
;; 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
require 'nokogiri' | |
require 'open-uri' | |
BASE_PATH = 'http://www.doc.ic.ac.uk/~svb/Schiele' | |
html_doc = Nokogiri::HTML(open(BASE_PATH) { |url| url.read }) | |
html_doc.xpath('//td//a', 'align' => 'center').each do |image_element| | |
image_name = image_element.values.first | |
next if File.file?(image_name) | |
download_path = File.join(BASE_PATH, image_name) |