Skip to content

Instantly share code, notes, and snippets.

View addisaden's full-sized avatar
🔍
Research Trip

addisaden addisaden

🔍
Research Trip
View GitHub Profile
@addisaden
addisaden / .gitignore
Last active August 29, 2015 13:57
How to establish diffrent database-connections
*.db
@addisaden
addisaden / rc.lua
Created March 13, 2014 08:54
my awesome config
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
awful.rules = require("awful.rules")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
@addisaden
addisaden / quick_todolist_with_active_record.rb
Created March 10, 2014 23:20
just created a quick todolist script with active record
require "active_record"
class Todo < ActiveRecord::Base
establish_connection adapter: 'sqlite3', database: 'sqlite3.quicktodo.db'
unless connection.table_exists?(table_name) then
connection.create_table table_name, force: true do |t|
t.boolean :done, default: false
t.string :todo
end
var fs = require("fs");
var http = require("http");
http.createServer(function (req, res) {
var current_path = "." + req.url;
if(req.url === "/") current_path = "./index.html";
fs.exists(current_path, function(exists) {
if(exists) {
fs.stat(current_path, function(err, stats) {
if(stats.isFile()) {
@addisaden
addisaden / hy --spy
Last active January 3, 2016 06:39
Get first the Pythoncode before execute hy
hy 0.9.12
=> (print "Hallo Welt")
print('Hallo Welt')
Hallo Welt
@addisaden
addisaden / car.hy
Last active January 3, 2016 06:39
This is Lisp in Python: Checkout hy at http://docs.hylang.org/en/latest/
(defclass Car []
[[--init--
(fn [self max-speed max-speedup]
(def self.speed 0)
(def self.max max-speed)
(def self.max-add max-speedup)
None)]
[gas
(fn [self speedup]
(do
def a_simple_decorator(f):
def a_logger_for_f(*args, **hashs):
print("Logger called")
result = f(*args, **hashs)
print("The result is: {}".format(result))
return result
return a_logger_for_f
@a_simple_decorator
def a_simple_method(a, b):
class A:
def hallo(self):
return "Hallo Welt"
def logger(obj, methodname):
tmp_method = getattr(obj, methodname)
def tmp_logger(*args):
print("Open:", methodname)
result = tmp_method(*args)
print("Closing:", methodname)
# -*- encoding: utf-8 -*-
import re
class TicTacToe:
def __init__(self):
self.field = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
self.winner_combinations =(
((0,0),(0,1),(0,2)),
((1,0),(1,1),(1,2)),
Die Bibel hat 66 Bücher.
1 Mose
Kapitelanzahl: 50
Längstes Kapitel: 24 mit 67 Versen.
Kürzestes Kapitel: 16 mit 16 Versen.
Gesamte Verszahl: 1533
Durchschittliche Kapitellänge:
Durchschnitt: 30.66 Verse
Median: 30.5 Verse