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 gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| " GistID: 963f95aaf61d50e512511ac4eb097e50 | |
| "Constantly improve at vim | |
| " http://vimgolf.com | |
| " http://derekwyatt.org/vim/tutorials/advanced/ | |
| " https://statico.github.io/vim3.html | |
| " https://www.reddit.com/r/vim/comments/8gmmk3/how_to_continue_to_improve_at_vim/ | |
| " https://stackoverflow.com/q/726894/2577465 | |
| "Why | |
| " http://www.viemu.com/a-why-vi-vim.html | |
| "Headstart |
| CS | |
| DMKS | |
| Heterogeneous programming | |
| OpenCl | |
| https://en.wikipedia.org/wiki/OpenCL | |
| Compilers | |
| Design patterns | |
| https://en.wikipedia.org/wiki/Worse_is_better | |
| File System | |
| File Descriptors |
| # GistID:963f95aaf61d50e512511ac4eb097e50 | |
| function add_alias() { | |
| if [[ -z $1 || -z $2 || $# -gt 2 ]]; then | |
| echo usage: | |
| echo "\t\$$0 ll 'ls -l'" | |
| else | |
| echo "alias $1='$2'" >> $ALIASFILE | |
| echo "alias ADDED to $ALIASFILE" | |
| alias $1="$2" | |
| fi |
| require 'json' | |
| require 'csv' | |
| def run_command(command) | |
| puts "Running command #{command}" | |
| res = `#{command}` | |
| return res | |
| end | |
| args = {} | |
| ARGV.each do |arg| |
stderr in red
2> >(while read line; do echo -e "\e[01;31m$line\e[0m" >&2; done)
| def self.find_byjs(hash) | |
| User.where("(json_store ->> '#{hash.keys.first}') = ?", hash.values.first).last | |
| end | |
| require 'json' | |
| token = YOUR_TOKEN | |
| cmd = "curl -H 'Authorization: Bearer #{token}' -H 'Accept-Language: en_US' -H 'Content-Type: application/json' 'https://api.uber.com/v1.2/history?limit=50'" | |
| res = `#{cmd}` | |
| b = JSON.parse(res) | |
| require 'csv' | |
| data = [["Request time", "Start time", "End time", "Distance", "Wait time", "Travel time", "Total time"]] | |
| b["history"].each do |item| | |
| rt = Time.at(item["request_time"]) | |
| rts = rt.strftime("%m/%d/%Y %I:%M%p") |
| This is too good http://www.brynosaurus.com/pub/net/p2pnat/[C[C |