Skip to content

Instantly share code, notes, and snippets.

View helllth's full-sized avatar

Thorsten Hell helllth

View GitHub Profile
@helllth
helllth / gist:1016767
Created June 9, 2011 13:53
query the index with an extended class list and derive the super objects from the children
with recursive derived_index(ocid,oid,acid,aid,depth) as (
select class_id,object_id,cast (null as int), cast (null as int),0
from GEOSUCHE where class_id in
(
with recursive derived_child(father,child,depth) as (
select father,father,0 from cs_class_hierarchy where father=183
union all
select ch.father,ch.child,dc.depth+1 from derived_child dc,cs_class_hierarchy ch where ch.father=dc.child)
select distinct father from derived_child limit 100
@helllth
helllth / Migration_GUP_Unterhaltungsmassnahme.sql
Created September 13, 2012 15:14
1:n Migration GUP_Unterhaltungsmassnahme
--nach Umstellung der Klassen (ABF) müssen noch diese Anpassungen (sync) gemacht werden
BEGIN WORK;
-- Legt eine neue Sequenz mit dem Namen "gup_massnahmenbezug_seq" an und startet bei dem Wert "1".
CREATE SEQUENCE gup_massnahmenbezug_seq MINVALUE 1 START 1;
CREATE TABLE gup_massnahmenbezug( id INTEGER PRIMARY KEY DEFAULT nextval('gup_massnahmenbezug_seq'), ort VARCHAR(32) NULL );
COMMIT WORK;
-- Löscht die Spalte "gup_massnahmen_ufer_links" aus der Tabelle "gup_planungsabschnitt".
ALTER TABLE gup_planungsabschnitt DROP COLUMN gup_massnahmen_ufer_links;
-- Löscht die Spalte "gup_massnahmen_umfeld_links" aus der Tabelle "gup_planungsabschnitt".
ALTER TABLE gup_planungsabschnitt DROP COLUMN gup_massnahmen_umfeld_links;
@helllth
helllth / gist:3760726
Created September 21, 2012 10:04
better pull
git fetch
git diff --stat ...origin/dev
git merge origin/dev
@helllth
helllth / boxcar.sh
Created September 25, 2012 13:26
send messages via boxcar (using generic provider)
#subscribe
curl -d 'email=me@mail.com' http://boxcar.io/devices/providers/MH0S7xOFSwVLNvNhTpiC/notifications/subscribe
#send message
curl -d 'email=me@mail.com' \
-d '&notification[from_screen_name]=Hello' \
-d '&notification[message]=github:gist is great' \
http://boxcar.io/devices/providers/MH0S7xOFSwVLNvNhTpiC/notifications
@helllth
helllth / pocket.js
Created November 4, 2012 10:33
+pocket Bookmarklet
javascript:(function()%7BISRIL_H='4b92';PKT_D='getpocket.com';ISRIL_SCRIPT=document.createElement('SCRIPT');ISRIL_SCRIPT.type='text/javascript';ISRIL_SCRIPT.src='http://'+PKT_D+'/b/r.js';document.getElementsByTagName('head')%5B0%5D.appendChild(ISRIL_SCRIPT)%7D)();
@helllth
helllth / createAGithubIssueWithCURL.bash
Last active December 15, 2015 03:39
a command to create an issue on github (even with line breaks in the body)
#!/bin/sh
curl -X POST -u '[user]:[pass]' -d @jsonFileLikeTheCommentsBelow.json https://api.github.com/repos/[user]/[reponame]/issues
#{"title": "curl Issue","body": "the body (with linebreaks)\n
# yes with linebreaks.\n
# just don't forget the backslash n at the end\n
#"}
@helllth
helllth / beep.sh
Last active December 19, 2015 00:39
Beeper ... makes some noise
#!/bin/bash
COUNTER=0
speech="th Beep"
speech2=" of "
pause=$2
if [ ! -z $1 ] && [ $1 = ? ]
then
echo "beep [nummer of beeps] [pause in seconds]"
exit
@helllth
helllth / pr.md
Created October 28, 2013 17:04 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

Keybase proof

I hereby claim:

  • I am helllth on github.
  • I am helllth (https://keybase.io/helllth) on keybase.
  • I have a public key whose fingerprint is D671 60A1 5EA0 CEE1 5A55 5865 B67F 8CF6 72D5 15A2

To claim this, I am signing this object:

@helllth
helllth / 0_reuse_code.js
Created June 3, 2014 13:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console