Skip to content

Instantly share code, notes, and snippets.

View bjelline's full-sized avatar

Brigitte Jellinek bjelline

View GitHub Profile
@bjelline
bjelline / copy into notebook.txt
Last active August 31, 2022 06:13
Pandas Wetter Beispiel
import pandas as pd
df = pd.read_csv('wetter-salzburg-2021.csv', index_col=0)
df
# ----------
import matplotlib.pyplot as plt
ax = df['tmax'].plot(color='tab:red', title="Temperatur Salzburg")
@bjelline
bjelline / klima_csv.py
Last active August 30, 2022 13:36
Listen mit Monaten und Daten
import csv
# Zwei Zeilen aus einer csv-Datei lesen:
with open('salzburg_daten.csv') as file:
reader = csv.reader(file, delimiter=';')
monate = next(reader)
temperaturen = next(reader)
$ wget -S https://barcamp-sbg.at --no-check-certificate
--2019-02-13 16:21:43-- https://barcamp-sbg.at/
Resolving barcamp-sbg.at (barcamp-sbg.at)... 138.201.31.98
Connecting to barcamp-sbg.at (barcamp-sbg.at)|138.201.31.98|:443... connected.
WARNING: no certificate subject alternative name matches
requested host name ‘barcamp-sbg.at’.
HTTP request sent, awaiting response...
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Wed, 13 Feb 2019 15:21:43 GMT
@bjelline
bjelline / capistrano_db_dump_and_clone_to_local.rb
Last active June 8, 2017 11:41 — forked from rrichards/capistrano_db_dump_and_clone_to_local.rb
Capistrano: Dump and clone to local database
# Directly copied from eycap-0.5.2 (thanks!)
#
# With these tasks you can:
# - dump your production database and save it in shared_path/db_backups
# - dump your production into your local database (clone_to_local)
#
# Tested and fixed by fjguzman
# migrated to capistrano 3 by bjelline
namespace :db do
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
// ==UserScript==
// @name FHSysUsability
// @namespace FHS
// @include https://fhsys.fh-salzburg.ac.at/*
// @version 1
// @grant none
// ==/UserScript==
function pick_sem_for_today(){
var today = new Date();
@bjelline
bjelline / chapter.js
Created May 10, 2016 13:44
my solution for code golf "chapter headings"
// my solution for code golf "chapter headings":
// https://codegolf.stackexchange.com/questions/79696/convert-header-levels-to-numbers
// created in https://ttdbin.com
function f(a){
var result = [];
for( var i in a ){
let r = [];
if(0 == i){
@bjelline
bjelline / parallel_in_the_commandline.sh
Created March 24, 2016 12:49
run stuff in parallel
ls | parallel 'cd {} && (bundle install; rake db:migrate)'
make -j 10
@bjelline
bjelline / gameoflife.js
Last active September 6, 2015 20:19
TDD: Game of Life
// functions for plain coordinate vectors:
// n-dimentional coordinate range from min to max
function min_max_coordinates( min_coords, max_coords ){
let results = [ [] ];
for(var i=0 ; i<min_coords.length; i++ ) {
let next_results = [];
results.forEach( left_end => {
for( let v=min_coords[i]; v<=max_coords[i]; v++ ){
let new_array = left_end.slice(); // copy array
@bjelline
bjelline / test_with_chrome.py
Created May 16, 2015 13:05
simplest selenium test with python and chrome
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome()
driver.get("http://localhost:5000/mood")
assert "Test App" in driver.title
el = driver.find_element_by_id('save')