This file contains hidden or 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
*.db |
This file contains hidden or 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
-- 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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
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()) { |
This file contains hidden or 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
hy 0.9.12 | |
=> (print "Hallo Welt") | |
print('Hallo Welt') | |
Hallo Welt |
This file contains hidden or 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
(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 |
This file contains hidden or 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
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): |
This file contains hidden or 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
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) |
This file contains hidden or 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 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)), |
This file contains hidden or 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
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 |