View sehirler.html
This file contains 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
<select name="Sehir"> | |
<option value="0">------</option> | |
<option value="1">Adana</option> | |
<option value="2">Adıyaman</option> | |
<option value="3">Afyonkarahisar</option> | |
<option value="4">Ağrı</option> | |
<option value="5">Amasya</option> | |
<option value="6">Ankara</option> | |
<option value="7">Antalya</option> | |
<option value="8">Artvin</option> |
View n11cat.py
This file contains 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 bs4 | |
import csv | |
import requests | |
r = requests.get("https://www.n11.com/site-haritasi") | |
soup = bs4.BeautifulSoup(r.text, features="html.parser") | |
with open("kategoriler.csv", "w") as csvfile: | |
writer = csv.writer(csvfile, delimiter=';', quotechar='"') | |
mcs = [(a.text, a.get('href')) for a in soup.find_all("a", class_="main-category")] |
View polen_crawler.py
This file contains 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
""" | |
This is a script for parsing polen levels in Madrid, Spain. | |
It used to work in 2019 but you may need to make fixes to make it work in the following years. | |
""" | |
import re | |
import locale | |
import time | |
import logging | |
import requests |
View skulpt-reveal.html
This file contains 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>reveal.js - The HTML Presentation Framework</title> | |
<meta name="description" content="A framework for easily creating beautiful presentations using HTML"> | |
<meta name="author" content="Hakim El Hattab"> |
View tweetfetcher.go
This file contains 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
package controllers | |
import ( | |
"github.com/revel/revel" | |
"fmt" | |
"time" | |
"gopkg.in/mgo.v2/bson" | |
"net/url" | |
"github.com/ChimeraCoder/anaconda" | |
"strconv" |
View pandas_dataframe_intersection.py
This file contains 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
# We have dataframe A with column name | |
# We have dataframe B with column name | |
# I want to see rows in A with name Y such that there exists rows in B with name Y. | |
# It's like set intersection. | |
intersected = reduce(lambda x, y: x | (A['name'] == y), [False] + list(B['name'])) | |
intersection = A[intersected] | |
# other alternatives | |
intersection = pd.merge(A, B, how='inner', on=['name']) | |
intersection.dropna(inplace=True) |
View bordro.py
This file contains 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
#encoding: utf-8 | |
import math | |
ay = 1 | |
BM = {} | |
EK = {} | |
AGI = {} | |
SM = {} |
View build_after_dropbox_sync.sh
This file contains 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/sh | |
uptodate () { | |
# returns 1 if up to date, 0 otherwise. | |
python /root/dropbox.py status | grep "Up to date" |wc -l | |
} | |
build_after_uptodate() { | |
while [ "$(uptodate)" != "1" ]; do | |
sleep 1 | |
done |
View heroku-bootup.py
This file contains 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 os | |
REGION = raw_input("Region? [US/eu] ").strip().lower() != "eu" | |
if REGION: | |
REGION = "us" | |
else: | |
REGION = "eu" | |
PROJECT_NAME = raw_input("Project name: ") | |
APP_NAME = raw_input("Initial app name: ") | |
USE_PGSQL = raw_input("Use PostgreSQL app? [Y/n] ").strip().lower() != "n" |
View HBaseEdgeInputFormat.java
This file contains 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
/* | |
* Licensed to the Apache Software Foundation (ASF) under one | |
* or more contributor license agreements. See the NOTICE file | |
* distributed with this work for additional information | |
* regarding copyright ownership. The ASF licenses this file | |
* to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
NewerOlder