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
-- modified from SQLite to PostgreSQL, --Andi 2024-07-01 | |
-- Common metadata ------------------------------------------------------------- | |
-- Units | |
CREATE TABLE units ( | |
id INTEGER PRIMARY KEY NOT NULL, | |
-- Metadata | |
name VARCHAR NOT NULL UNIQUE, |
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
CREATE INDEX "items_alternate_ids_idx" ON "items" USING GIN ("alternate_ids"); | |
CREATE OR REPLACE FUNCTION items_by_ids(ids text[], is_published boolean DEFAULT NULL) | |
RETURNS SETOF items | |
AS $$ | |
SELECT items.* | |
FROM unnest($1) WITH ORDINALITY t(value, ord), items | |
WHERE ( | |
items.core_id = t.value | |
OR items.id = CASE WHEN isnumeric(t.value) THEN t.value::integer ELSE null END |
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
<?php | |
/* | |
SELECT meta_value, u.user_login, u.user_registred, u.display_name | |
FROM wp_usermeta um LEFT JOIN wp_users u ON u.id = um.user_id | |
WHERE um.meta_key = 'session_tokens'; | |
*/ | |
$file = file('wp-usermeta.csv'); |
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
''' | |
Downloads YouTube subtitles to human readable text, while fixing casing of german words. | |
Example usage: | |
python3 yt2text.py _RlwgfYd65Q > ultraschall5.txt | |
''' | |
import argparse | |
from youtube_transcript_api import YouTubeTranscriptApi |
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/bash | |
# see https://www.screenly.io/blog/2017/07/02/how-to-automatically-turn-off-and-on-your-monitor-from-your-raspberry-pi/#cec-client | |
# and crontab -e (of user "pi") --Andi | |
case "$1" in | |
on) | |
echo 'on 0' | cec-client -s -d 1 | |
;; | |
off) | |
echo 'standby 0' | cec-client -s -d 1 |
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
<?php | |
define('DOKU_INC', '../dokuwiki/'); | |
define('DOKU_PLUGIN', '../'); | |
require_once(DOKU_INC . 'inc/load.php'); | |
require_once(DOKU_PLUGIN.'sqlite/helper.php'); | |
class data_api { |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
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
# coding=utf-8 | |
import config | |
from flask import Flask, Response, request, json | |
import requests | |
import ssl | |
app = Flask(__name__) |
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
# basiert auf https://twitter.com/realgiggls/status/693081083211051008 | |
date | |
for ((i=25;i>0;i--)); do | |
echo $i | |
sleep 60 | |
done | |
say -v Anna "Timer abgelaufen" | |
xmessage "Timer abgelaufen $(date '+%H:%m')" |
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
# -*- coding: UTF-8 -*- | |
#import requests | |
import json | |
from collections import OrderedDict | |
def main(): | |
data = None | |
session = "7306" #wget https://lab.dsst.io/32c3-slides/slides/7306.json |
NewerOlder