Skip to content

Instantly share code, notes, and snippets.

View carlos-aguayo's full-sized avatar

Carlos Aguayo carlos-aguayo

View GitHub Profile
@carlos-aguayo
carlos-aguayo / removedups.py
Last active August 29, 2015 14:03
Python - Remove duplicated files
import os, hashlib
from os import listdir
from os.path import isfile, join
mypath = "."
files = [ f for f in listdir(mypath) if isfile(join(mypath,f)) ]
hashes = set()
@carlos-aguayo
carlos-aguayo / gist:5bd33f0c5007acb0de7f
Created January 17, 2015 23:49
Turing machine, single head, single tape
######################################################################
# Task: Describe a Turing machine that shifts the input string one
# space to the right and places the symbol ($) in the first location
# on the tape.
######################################################################
# Enter values below for
# q_0 : the initial state (an int)
# q_a : the accept state (an int)
# q_r : the reject state (an int)
# delta : the transition function expressed as a dictionary
<replace-with class="com.dreamskiale.client.history.Html5Historian">
<when-type-is class="com.google.gwt.place.shared.PlaceHistoryHandler.DefaultHistorian"/>
<any>
<when-property-is name="user.agent" value="gecko1_8"/>
<when-property-is name="user.agent" value="safari"/>
<when-property-is name="user.agent" value="opera"/>
</any>
</replace-with>
<replace-with class="com.dreamskiale.client.history.HashBangHistorian">
<when-type-is class="com.google.gwt.place.shared.PlaceHistoryHandler.DefaultHistorian"/>
private native void pushState(String url) /*-{
url += $wnd.location.search;
$wnd.history.pushState(null, $doc.title, url);
}-*/;
private native void replaceState(String url) /*-{
url += $wnd.location.search;
$wnd.history.replaceState(null, $doc.title, url);
}-*/;
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p>hello world</p>
</body>
</html>
@carlos-aguayo
carlos-aguayo / jira.py
Last active July 26, 2017 02:30
Get an Excel report on the number of comments in JIRA tickets
from jira import JIRA
from dateutil.parser import parse
import pandas as pd
# For any ticket that was externally reported or labeled a hotfix in the last 90 days, compute:
# 1. Number of comments
# 2. How long it took for it to be labeled hotfix
# 3. Number of transitions across squads
username = 'carlos.aguayo'
@carlos-aguayo
carlos-aguayo / screenshot.py
Created February 19, 2018 21:19
Given a filename, find all http links and take a screenshot of them.
from selenium import webdriver
from BeautifulSoup import BeautifulSoup
import requests
options = webdriver.ChromeOptions()
options.add_argument('headless')
driver = webdriver.Chrome(chrome_options=options)
driver.set_window_size(1280, 1600)
filename = 'NOTICE.html'
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.