Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
This is a little trick I use to spin up the packages instalation on Debian/Ubuntu boxes in Vagrant.
I add a simple function that checks if a directory named something similar to ~/.vagrant.d/cache/apt/opscode-ubuntu-12.04/partial (it may have another path in Windows or MacOS) and create the directory if it doesn't already exist.
def local_cache(basebox_name)
cache_dir = Vagrant::Environment.new.home_path.join('cache', 'apt', basebox_name)
partial_dir = cache_dir.join('partial')
partial_dir.mkdir unless partial_dir.exist?
cache_dir| { | |
| "files": | |
| { | |
| "Chart.js": "https://github.com/nnnick/Chart.js", | |
| "Modernizr.js": "http://modernizr.com/downloads/modernizr-latest.js", | |
| "Normalize.css 1.x": "https://github.com/necolas/normalize.css/blob/v1.1.3/normalize.css", | |
| "Normalize.css 2.x": "https://github.com/necolas/normalize.css/blob/v2.1.3/normalize.css", | |
| "Normalize.css 3.x": "https://raw.githubusercontent.com/necolas/normalize.css/master/normalize.css", | |
| "Respond.js": "https://github.com/scottjehl/Respond/blob/master/dest/respond.min.js", | |
| "Sanitize.css": "https://raw.github.com/ZDroid/sanitize.css/master/sanitize.css", |
| 74925 NONE | |
| 54706 MIT | |
| 9268 ISC | |
| 3050 BSD | |
| 1521 BSD-2-CLAUSE | |
| 791 APACHE-2.0 | |
| 699 APACHE 2.0 | |
| 392 BSD-3-CLAUSE | |
| 364 WTFPL | |
| 346 UNKNOWN |
| <script type="text/javascript"> | |
| (function () { | |
| "use strict"; | |
| // once cached, the css file is stored on the client forever unless | |
| // the URL below is changed. Any change will invalidate the cache | |
| var css_href = './index_files/web-fonts.css'; | |
| // a simple event handler wrapper | |
| function on(el, ev, callback) { | |
| if (el.addEventListener) { | |
| el.addEventListener(ev, callback, false); |
| BOX_NAME=vagrant-build | |
| BASE_DIR="`pwd`/machines" | |
| BOX_DIR="${BASE_DIR}/${BOX_NAME}" | |
| mkdir -p ${BASE_DIR} | |
| VBoxManage createvm --name "${BOX_NAME}" --ostype RedHat_64 --basefolder ${BASE_DIR} | |
| VBoxManage registervm "${BOX_DIR}/${BOX_NAME}.vbox" | |
| mkdir -p tmp |