This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REPOS="repo1 repo2 repo3" | |
BASE_DIR="/Users/user/repo_home" # Where you repos are | |
OUTPUT_FILE="/Users/user/Documents/git-stats.html" | |
for repo in $REPOS; do | |
cd "$BASE_DIR/$repo" | |
echo "Updating repo $repo" | |
git fetch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import avinit | |
avinit.get_svg_avatar('Douglas Adams') | |
# Returns: | |
# '<svg xmlns="http://www.w3.org/2000/svg" pointer-events="none" width="46" height="46" style="width: 46px; border-radius: 0px; -moz-border-radius: 0px; background-color: #34495e; height: 46px"> <text text-anchor="middle" y="50%" x="50%" dy="0.35em" pointer-events="auto" fill="#ffffff" font-family="HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif" style="font-size: 20px; font-weight: 400">DA</text> </svg>' | |
avinit.get_avatar_data_url('Douglas Adams') | |
# Returns: | |
# 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHBvaW50ZXItZXZlbnRzPSJub25lIiB3aWR0aD0iNDYiIGhlaWdodD0iNDYiIHN0eWxlPSJ3aWR0aDogNDZweDsgYm9yZGVyLXJhZGl1czogMHB4OyAtbW96LWJvcmRlci1yYWRpdXM6IDBweDsgYmFja2dyb3VuZC1jb2xvcjogIzM0NDk1ZTsgaGVpZ2h0OiA0NnB4Ij4gPHRleHQgdGV4dC1hbmNob3I9Im1pZGRsZSIgeT0iNTAlIiB4PSI1MCUiIGR5PSIwLjM1ZW0iIHBvaW50ZXItZXZlbnRzPSJhdXRvIiBmaWxsPSIjZmZmZmZmIiBmb250LWZhbWlseT0iSGVsdmV0aWNhTmV1ZS1M |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<svg xmlns=”http://www.w3.org/2000/svg" pointer-events=”none” width=”{width}” | |
height=”{height}” style=”{style}”> | |
<text text-anchor=”middle” y=”50%” x=”50%” dy=”0.35em” | |
pointer-events=”auto” fill=”#ffffff” font-family=”{font-family}” | |
style=”{text-style}”>{text}</text> | |
</svg> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ERROR_MESSAGES = [ | |
'Warning: React.createElement', | |
'Failed propType:' | |
]; | |
/* Turn console.error messages into failing tests */ | |
console.error = (logger => (...options) => { | |
const [message, ..._rest] = options; | |
ERROR_MESSAGES.forEach(error_message => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import functools | |
import itertools | |
import requests | |
from elasticsearch import Elasticsearch | |
from elasticsearch.helpers import bulk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r -U3 newrelic/api/web_transaction.py newrelic/api/web_transaction.py | |
--- newrelic/api/web_transaction.py 2017-05-26 15:13:50.000000000 -0300 | |
+++ newrelic/api/web_transaction.py 2017-08-11 15:28:16.000000000 -0300 | |
@@ -720,11 +720,15 @@ | |
class _WSGIApplicationIterable(object): | |
- def __init__(self, transaction, generator): | |
+ def __init__(self, transaction, generator, group=None): | |
self.transaction = transaction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let iters = 0; | |
function greedyThief(items, n){ | |
iters = 0 | |
const new_items = [...items] | |
const sorted_items = new_items.sort((a, b) => { | |
const w_diff = b.weight - a.weight | |
if (w_diff === 0) { | |
return b.price - a.price | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import calendar | |
import itertools as it | |
from datetime import datetime | |
from csv2ofx import utils | |
from csv2ofx.mappings.default import mapping | |
from csv2ofx.ofx import OFX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Execute command only if configuration changes. | |
if not compare_args_ipa(ansible_module, args, res_find): | |
try: | |
api_command_no_name(ansible_module, 'dnsconfig_mod', args) | |
except Exception as e: | |
msg = str(e) | |
ansible_module.fail_json(msg="dnsconfig_mod: %s" % msg) | |
else: | |
# If command did not fail, something changed. | |
changed = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"amazon2": { | |
"qcow": "amzn2-kvm-2.0.20190313-x86_64.xfs.gpt.qcow2", | |
"os_type": "linux", | |
"os_variant": "auto", | |
"image_url": "https://cdn.amazonlinux.com/os-images/2.0.20190313/kvm", | |
"disk_format": "qcow2", | |
"login_user": "ec2-user" | |
}, |