Skip to content

Instantly share code, notes, and snippets.

@frewsxcv
frewsxcv / datadog_tracing_stripe.rb
Created Feb 6, 2020
Stripe + Datadog Tracing integration
View datadog_tracing_stripe.rb
module Stripe::APIOperations::Request::ClassMethods
old_request = instance_method(:request)
define_method(:request) do |*args|
span = Datadog.tracer.trace('stripe.request', span_type: 'http')
begin
result = old_request.bind(self).call(*args)
rescue Stripe::StripeError => e
span.set_error(e)
View gist:a507afbfcf8e5751969d4d124535b8dc
### Keybase proof
I hereby claim:
* I am frewsxcv on github.
* I am corey (https://keybase.io/corey) on keybase.
* I have a public key ASDSf2dQ_6_LFKPzBvssH82uSaiFV_PgXfy9L-4Qv_NAWQo
To claim this, I am signing this object:
View regex-fuzz-target.rs
extern crate afl;
extern crate regex;
fn main() {
afl::read_stdio_string(|string| {
let mut split = string.split('\n');
let s1 = match split.next() {
Some(s) => s,
None => return,
View LetterCountI.js
function LetterCountI(str) {
str = str.split(" ");
var answer = "";
var mostRep = 1;
for (i = 0; i < str.length; i++)
if (eachWord(str[i]) > mostRep) {
mostRep = eachWord(str[i]);
answer = str[i];
}
if (mostRep === 1)
View gist:6772538
func update(a string, b string) (error) {
return foo := model.MethodA(a)
|| bar := model.MethodB(b)
|| model.CheckStuffA(foo, bar)
|| model.CheckStuffB(foo, bar)
|| model.Update(foo, bar)
}
View gist:5416325
var key;
for (key in myobj) {
if (myobj.hasOwnProperty(key)) {
console.log(key, myobj[key]);
}
}
//////////////////////////////////////
View gist:5370174
/* Unsorted */
/* this fixes self vs. internal link */
ul.tabmenu.formtab {
margin: 43px 0 0 0;
}
.commentarea .md a {
text-decoration: underline;
}
View gist:5127433
void XmppSipPlugin::onPresenceReceived(const Ptr&, const Jreen::Presence&) * New presence: "randyychan@gmail.com/android_talk45ee213fa697" 10
void XmppSipPlugin::onPresenceReceived(const Ptr&, const Jreen::Presence&) "randyychan@gmail.com/android_talk45ee213fa697" Running tomahawk: maybe caps "http://www.android.com/gtalk/client/caps" requesting disco...
Jreen:Debug:send iq to "randyychan@gmail.com/android_talk45ee213fa697" from ""
Jreen:Debug:send iq to "randyychan@gmail.com" from ""
Servent::SocketError: QAbstractSocket::SocketTimeoutError "7b6c0e5e-4e58-4dc7-a1dd-4e9cfd01cf26" "liam.carter.condon@gmail.com/tomahawk77E6FB4566"
Connection "7b6c0e5e-4e58-4dc7-a1dd-4e9cfd01cf26" FAILED *************** QThread(0x1fcfa20)
void Connection::shutdown(bool) false "7b6c0e5e-4e58-4dc7-a1dd-4e9cfd01cf26"
void Connection::actualShutdown() false "7b6c0e5e-4e58-4dc7-a1dd-4e9cfd01cf26"
DTOR controlconnection
DTOR connection (super) "7b6c0e5e-4e58-4dc7-a1dd-4e9cfd01cf26" QThread(0x1fcfa20) true
View gist:5127347
import itertools
import time
def finish_off(cards, deck1, deck2):
while len(deck1) != 0 and len(deck2) != 0:
try:
cards.insert(0, deck1.pop())
cards.insert(0, deck2.pop())
except IndexError:
pass
@frewsxcv
frewsxcv / README.md
Created Dec 6, 2012 — forked from mbostock/.block
Stacked Area Chart
View README.md

This stacked area chart is constructed from a TSV file storing the market share of several popular web browsers over the last year. Data is from Clicky Web Analytics. The chart employs conventional margins and a number of D3 features:

You can’t perform that action at this time.