Swagger (OpenAPI) 2.0 spec to generate New Relic clients and documentation, in response to https://discuss.newrelic.com/t/api-declaration-swagger-for-example/35365
Contributed by Ian Katz ikatz@drizly.com with permission from Drizly.
<%* | |
/* | |
# Hypothes.idian a templater script for retrieving annotations from Hypothes.is | |
Dev: TfTHacker https://twitter.com/TfTHacker | |
# Prerequisites: | |
+ Templater plugin by https://github.com/SilentVoid13/Templater | |
+ Free Hypothes.is developer token from: https://hypothes.is/account/developer | |
+ This script will prompt you for his token and save it to a file called "hypothesis config.md" | |
+ This file store your configuration and can be located any where in your vault. |
Swagger (OpenAPI) 2.0 spec to generate New Relic clients and documentation, in response to https://discuss.newrelic.com/t/api-declaration-swagger-for-example/35365
Contributed by Ian Katz ikatz@drizly.com with permission from Drizly.
// 1. Go to https://twitter.com/i/likes | |
// 2. Keep scrolling to the bottom repeatedly until all your favs are loaded. | |
// 3. Run this in your console (open in chrome by View > Developer > JavaScript Console) | |
// Notes: this may take a while if you have a lot of favs/likes | |
// you can only access your most recent ~2000 likes. | |
// inspired by https://gist.github.com/JamieMason/7580315 | |
$('.ProfileTweet-actionButtonUndo').click() |
Plugboard = Hash[*('A'..'Z').to_a.sample(20)] | |
Plugboard.merge!(Plugboard.invert) | |
Plugboard.default_proc = proc { |_, key| key } | |
def build_a_rotor | |
Hash[('A'..'Z').zip(('A'..'Z').to_a.shuffle)] | |
end | |
ROTOR_1, ROTOR_2, ROTOR_3 = build_a_rotor, build_a_rotor, build_a_rotor |
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep -B6 bindings:.*: |
See https://www.youtube.com/watch?v=4_RJu_TrqO0&feature=youtu.be&t=8h6m40s
$ ruby dilute.rb fib.rb
def fi n
if n < 3
1
else
fib(n-1 + ib(n
end
require 'benchmark/ips' | |
a = (0..10).to_a | |
Benchmark.ips do |x| | |
x.report("push") { a.dup.push(100) } | |
x.report("shovel") { a.dup << 100 } | |
x.report("concat") { a.dup.concat([100]) } | |
x.report("+") { a + [100] } | |
x.report("unshift") { a.dup.unshift(100) } |
# IMPORTANT NOTE: This hack has evolved, and HistoryPx is now a full PowerShell module | |
# that is hosted on GitHub and can be found here: github.com/KirkMunro/HistoryPx | |
# First set up some interesting hacks | |
New-Module -Name HistoryPx -ScriptBlock { | |
$PSModule = $ExecutionContext.SessionState.Module | |
$global:__ = $null | |
$global:MaximumDetailedHistoryCount = 50 | |
$global:PSDefaultParameterValues['Out-Default:OutVariable'] = 'global:__' | |
$commandHistory = [ordered]@{} |
#!/usr/bin/env ruby | |
# A sneaky wrapper around Rubocop that allows you to run it only against | |
# the recent changes, as opposed to the whole project. It lets you | |
# enforce the style guide for new/modified code only, as opposed to | |
# having to restyle everything or adding cops incrementally. It relies | |
# on git to figure out which files to check. | |
# | |
# Here are some options you can pass in addition to the ones in rubocop: | |
# |