Skip to content

Instantly share code, notes, and snippets.

View plotti's full-sized avatar

Thomas Ebermann plotti

View GitHub Profile
// ==UserScript==
// @name Remove_news
// @version 1
// @grant none
// @include https://www.watson.ch/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// ==/UserScript==
//https://gist.github.com/BrockA/2625891
function recurseEl(father,element) {
@plotti
plotti / dogs
Created September 9, 2021 14:13
### Variante 1
aarons = []
with open("20151001_hundenamen.csv") as file:
for line in file:
data = line.split(",")
if data[0] == '"Aaron"':
if int(data[1]) > 2000 and int(data[1]) < 2012:
aarons.append(line)
len(aarons)
@plotti
plotti / files
Created September 9, 2021 12:33
!wget https://raw.githubusercontent.com/MAZ-CAS-DDJ/kurs_21_22/master/03%20Python%20Teil%202/lesen.txt
!wget https://raw.githubusercontent.com/MAZ-CAS-DDJ/kurs_21_22/master/03%20Python%20Teil%202/datei.csv
!wget https://raw.githubusercontent.com/MAZ-CAS-DDJ/kurs_21_22/master/03%20Python%20Teil%202/20151001_hundenamen.csv
!wget https://raw.githubusercontent.com/MAZ-CAS-DDJ/kurs_21_22/master/03%20Python%20Teil%202/schreiben.txt
@plotti
plotti / dicts
Created September 9, 2021 12:12
liste = ["Hallo", "Hallo", "Welt", "Hallo", "Mars"]
#d = {"Hallo": 3, "Welt": 1, "Mars": 1}
#1
for element in liste:
if element in d:
d[element] += 1
else:
d[element] = 1
# dein code hier :)
students = ["Max", "Monika", "Monika", "Franz"]
def remove_all(list, element):
while element in list:
list.remove(element)
return list
def remove_all2(list,element):
for item in list:
07/08/2014
5:28 pm
The battle is on! Im heutigen #HomeRunjoiz-Fight stehen sich Rap und Rock gegenüber: DritteStock vs. Dirty Sound Magnet! Jetzt auf www.joiz.ch/LIVE mitchatten und mit deiner Stimme im Voting über Sieg oder Niederlage entscheiden!
Photo
Public
0
Organic
0
Paid
0
@plotti
plotti / gist:3182197
Created July 26, 2012 14:01
Sample output for zephoria
---
- - tech
- :count: 13
:names:
- - BillGates
- "7"
- - biz
- "23"
- - ev
- "17"
@plotti
plotti / gist:3182164
Created July 26, 2012 13:55
User interests extraction
require '../config/environment'
interests = {}
rows = FasterCSV.read("#{RAILS_ROOT}/analysis/data/partitions/final_partitions_p100_200_0.2.csv")
rows.each do |row|
interests[row[0]] = {:category => row[1], :count => row[2]}
end
project = Project.last
ids = project.persons.collect{|p| p.twitter_id}
@plotti
plotti / gist:2972459
Created June 22, 2012 12:26
benchmark
require 'benchmark'
puts Benchmark.measure{Project.find(1).find_at_connections}
31.660000 0.540000 32.200000 ( 35.293887)