Skip to content

Instantly share code, notes, and snippets.

View managedkaos's full-sized avatar
💭
Time for some Actions! :D

Michael managedkaos

💭
Time for some Actions! :D
View GitHub Profile
@managedkaos
managedkaos / azlyrics.py
Created August 1, 2017 04:29
Scrape lyrics from azlyrics.com
import requests
from bs4 import BeautifulSoup
url = "http://www.azlyrics.com/lyrics/onyx/bacdafucup.html"
print "Default request (it will fail)..."
# make the default request
try:
r = requests.get(url)
@managedkaos
managedkaos / github_status.py
Created July 31, 2017 19:37
A python script to scrape the status metrics from https://status.github.com/
import requests
from bs4 import BeautifulSoup
# make a request for the data
r = requests.get('https://status.github.com/')
# convert the response text to soup
soup = BeautifulSoup(r.text, "lxml")
# get all the divs with the "graph" class
#!/usr/bin/env perl
# for hackerrank https://www.hackerrank.com/challenges/nested-list/problem
# read the input file
@input = <>;
# get the first line; that's the number of students
$count = shift @input;
# process the rest of the input...
@managedkaos
managedkaos / config.xml
Created June 8, 2017 06:32
Jenkins 'hello world' job
<?xml version='1.0' encoding='UTF-8'?>
<project>
<description>hello-world</description>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
days = ['Monday','Tuesday','Wednesday','Thursday','Friday']
today = datetime.datetime.today().strftime('%A')
tomorrow = (datetime.date.today() + datetime.timedelta(days=1)).strftime('%A')
day = tomorrow
day_counter=0
for cell_menu_item in row('div',{'class':'cell_menu_item'}):
if day not in days[day_counter]:
import uuid
import json
import random
import datetime
id = str(uuid.uuid1())
actions = ['purchase1', 'purchase2', 'version']
print json.dumps({'date' : str(datetime.datetime.now()), 'id' : id, 'action' : 'install'})
for i in xrange(10):