Skip to content

Instantly share code, notes, and snippets.

🏠
Remote

Michael Benin michaelBenin

🏠
Remote
Block or report user

Report or block michaelBenin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@michaelBenin
michaelBenin / gist:baa9a94a2353c0e35d71bfba7045e4ea
Created Jun 23, 2019 — forked from spalger/gist:6417923
Inject jQuery and lodash into the current tab via a bookmarklet. To use, just create a new bookmark and use this as the URL.
View gist:baa9a94a2353c0e35d71bfba7045e4ea
javascript: (function () {
var el = document.createElement('pre'),
b = document.getElementsByTagName('body')[0],
otherjQuery = false,
msg = '',
libs = [
function loadjQuery() {
if (typeof jQuery != 'undefined') {
showMsg('This page already using jQuery v' + jQuery.fn.jquery);
} else {
@michaelBenin
michaelBenin / utc_timezone.json
Created Mar 27, 2018
list of all utc timezones sorted
View utc_timezone.json
[
"MST7MDT",
"PST8PDT",
"Etc/GMT",
"EST5EDT",
"CST6CDT",
"Etc/GMT-1",
"Etc/GMT-8",
"Etc/GMT-7",
"Etc/GMT-6",
View language-subtag-registry.json
[{"Type":"language","Subtag":"aa","Description":"Afar","Added":"2005-10-16"},{"Type":"language","Subtag":"ab","Description":"Abkhazian","Added":"2005-10-16","Suppress-Script":"Cyrl"},{"Type":"language","Subtag":"ae","Description":"Avestan","Added":"2005-10-16"},{"Type":"language","Subtag":"af","Description":"Afrikaans","Added":"2005-10-16","Suppress-Script":"Latn"},{"Type":"language","Subtag":"ak","Description":"Akan","Added":"2005-10-16","Scope":"macrolanguage"},{"Type":"language","Subtag":"am","Description":"Amharic","Added":"2005-10-16","Suppress-Script":"Ethi"},{"Type":"language","Subtag":"an","Description":"Aragonese","Added":"2005-10-16"},{"Type":"language","Subtag":"ar","Description":"Arabic","Added":"2005-10-16","Suppress-Script":"Arab","Scope":"macrolanguage"},{"Type":"language","Subtag":"as","Description":"Assamese","Added":"2005-10-16","Suppress-Script":"Beng"},{"Type":"language","Subtag":"av","Description":"Avaric","Added":"2005-10-16"},{"Type":"language","Subtag":"ay","Description":"Aymara","Adde
@michaelBenin
michaelBenin / example.py
Created Feb 24, 2018
Bluebird's Promise.map in python
View example.py
'''Debugging: https://docs.python.org/3/library/asyncio-dev.html#asyncio-dev'''
def fetch_urls_concurrent(urls):
loop = asyncio.new_event_loop()
resp_list = []
async def async_req_urls():
'''Change max workers for concurrency'''
with concurrent.futures.ThreadPoolExecutor(max_workers=20) as executor:
futures = []
View gist:846b6cea423e9960013388dfaab62fda
about:blank:1 Mixed Content: The page at 'https://www.fastcompany.com/40484989/amazon-should-put-its-new-headquarters-in-puerto-rico' was loaded over HTTPS, but requested an insecure image 'http://tags.bluekai.com/site/1407?partner=1&uhint=na_id=2016091808381073644101408625&redir=http%3A%2F%2Fe.nexac.com%2Fe%2Fbk_sync.xgi%3Fna_exid%3D%24_BK_UUID'. This content should also be served over HTTPS.
about:blank:1 Mixed Content: The page at 'https://www.fastcompany.com/40484989/amazon-should-put-its-new-headquarters-in-puerto-rico' was loaded over HTTPS, but requested an insecure image 'http://cm.g.doubleclick.net/pixel?google_nid=datalogix_dmp&google_cm'. This content should also be served over HTTPS.
about:blank:1 Mixed Content: The page at 'https://www.fastcompany.com/40484989/amazon-should-put-its-new-headquarters-in-puerto-rico' was loaded over HTTPS, but requested an insecure image 'http://e.nexac.com/e/googlegdn_sync.xgi?na_exid=CAESEOM-jIkZzPAqKkCx0z7_SWk&google_cver=1'. This content should also be served ov
View change-resource-tags.sh
#!/bin/bash
ids=$(aws ec2 describe-instances --filter "Name=tag:Project,Values=ERPSystem" "Name=tag:Environment,Values=development" --query 'Reservations[*].Instances[*].InstanceId' --output text)
echo "Creating tags"
aws ec2 create-tags --resources $ids --tags 'Key=Version,Value=1.1'
echo "Tags created"
@michaelBenin
michaelBenin / snapshotter.py
Created May 11, 2017
Hold only the last two snapshots
View snapshotter.py
#!/usr/bin/env python
import boto3
MAX_SNAPSHOTS = 2 # Number of snapshots to keep
# Create the EC2 resource
ec2 = boto3.resource('ec2')
# Get a list of all volumes
@michaelBenin
michaelBenin / metadata.js
Last active Jan 23, 2017
Script to grab existing meta data on a webpage in a data structure consumable by react-helmet
View metadata.js
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = 'https://code.jquery.com/jquery-3.1.1.min.js';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
var f = document.createElement('script');
f.type = 'text/javascript';
View gist:59ffbf20c87000bb4b2ac88652a70951
============================================
Domain (global)
Description
# of Credentials 1
============================================
Id Name
==================================== =======
someid jenkins
============================================
@michaelBenin
michaelBenin / config component
Created Feb 9, 2016
This is the config component I use for my Universal React Apps
View config component
import React from 'react';
export default React.createClass({
createConfig() {
return {
__html: this.props.config
};
},
render() {
You can’t perform that action at this time.