Skip to content

Instantly share code, notes, and snippets.

View klashxx's full-sized avatar
💭
I may be slow to respond.

Juan Diego Godoy Robles klashxx

💭
I may be slow to respond.
View GitHub Profile
{
"window.zoomLevel": 1,
"go.gopath": "/Users/klashxx/Documents/dev/go",
"files.trimTrailingWhitespace": true,
"git.confirmSync": false,
"workbench.colorTheme": "Plastic",
"workbench.iconTheme": "vscode-icons",
"go.autocompleteUnimportedPackages": true
}
app.js
require('./logger');
document.write('welcome to my app');
console.log('app loaded');
global.js
#!/usr/bin/env python
from selenium import webdriver
from bs4 import BeautifulSoup
browser = webdriver.Chrome()
with open('./urls.dat', 'r') as urls:
for url in urls:
browser.get(url)
soup = BeautifulSoup(browser.page_source, 'lxml')
meta_title = soup.find('meta', property='og:title')['content']
#!/usr/bin/env python
import re
import urllib
import requests
from bs4 import BeautifulSoup
with open('urls', 'r') as urls:
for url in urls:
if 'wiki' not in url:
#!/usr/bin/env python
import re
import urllib
with open('urls', 'r') as urls:
for url in urls:
if 'wiki' not in url:
continue
enc = re.search(r'https.*(?:File|Archivo):([^:]+)\.\S+$', url)
if enc is None:
@klashxx
klashxx / .block
Created April 29, 2017 14:12 — forked from mbostock/.block
Line Transition
license: gpl-3.0
@klashxx
klashxx / live-update-chartjs.html
Created April 29, 2017 13:08 — forked from geoff-parsons/live-update-chartjs.html
Example of live updating Chart.js charts.
<!DOCTYPE html>
<html>
<head>
<title>Chart.js Redraw Example</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="chart.min.js"></script>
<script type="text/javascript" charset="utf-8">
window.chartOptions = {
segmentShowStroke: false,
<!DOCTYPE html>
<html>
<head>
<title>CSS Horizontal Traffic Light</title>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
</head>
import itertools
import pandas as pd
from shapely.geometry import Polygon
from shapely.geometry.multipolygon import MultiPolygon
umbral = 0.8
list_poligonos = []
df = pd.read_csv('polygons15.csv', names=['x1', 'y1', 'x2', 'y2', 'x3', 'y3', 'x4', 'y4', 'umbral', 'd'] )
@klashxx
klashxx / linux.sh
Created January 9, 2017 01:38 — forked from marcan/linux.sh
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <[email protected]>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name