An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
MIT License | |
Copyright (c) 2014 Piotr Kuczynski | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWAR |
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
// XPath CheatSheet | |
// To test XPath in your Chrome Debugger: $x('/html/body') | |
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/ | |
// 0. XPath Examples. | |
// More: http://xpath.alephzarro.com/content/cheatsheet.html | |
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class |
ℹ️ Please note this research is from 2016 when Opera has first added their browser "VPN", even before the "Chinese deal" was closed. They have since introduced some real VPN apps but this below is not about them.
🕵️ Some folks also like to use this article to show a proof that the Opera browser is a spyware or that Opera sells all your data to 3rd parties or something like that. This article here doesn't say anything like that.
When setting up (that's immediately when user enables it in settings) Opera VPN sends few API requests to https://api.surfeasy.com to obtain credentials and proxy IPs, see below, also see The Oprah Proxy.
The browser then talks to a proxy de0.opera-proxy.net
(when VPN location is set to Germany), it's IP address can only be resolved from within Opera when VPN is on, it's 185.108.219.42
(or similar, see below). It's an HTTP/S proxy which requires auth.
# Sample reference code for doubles/mocks, stubs, and spies in RSpec | |
# Taken from Kevin Skoglund's RSpec tutorial on Lynda.com | |
describe 'Doubles' do | |
it "allows stubbing methods" do | |
dbl = double("Chant") | |
allow(dbl).to receive(:hey!) | |
expect(dbl).to respond_to(:hey!) | |
end |
# Find files that: | |
# 1.) are .rb files | |
# 2.) contain 'last_name' | |
# 3.) do NOT contain 'name_suffix' | |
# USING AG | |
ag -LG '.*\.rb' 'name_suffix' . | xargs ag 'last_name' | |
# USING GREP | |
find . -name "*.rb" -print | xargs grep -l 'last_name' | xargs grep -L 'name_suffix' |
# Ruby 1.9 using #set_trace_func | |
trace_log = '/application/log/trace.log' | |
File.write(trace_log, "#{'#'*150}\n"*5) | |
set_trace_func proc { |event, file, line, id, binding, classname| | |
unless file.include?('/usr/') || file.include?('/opt/') | |
LAST_FUNC ||= {} | |
unless LAST_FUNC[:id] == id && LAST_FUNC[:classname] = classname | |
file = file.sub('/application/', '') | |
file_line = "#{file}:#{line}" | |
string_format = "%-55s %20s %-60s\n" |
Related: https://www.rubydoc.info/gems/rubocop-rspec/1.6.0/RuboCop/Cop/RSpec/AnyInstance |
#!/bin/zsh | |
set -eu | |
# Run Rubocop on changed files only | |
git diff --name-only --diff-filter=d upstream/develop | xargs bundle exec rubocop --only-recognized-file-types "$@" |