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
| select * from tablename t1 | |
| where (select count(*) from tablename t2 | |
| where t1.fieldname = t2.fieldname) > 1 | |
| order by fieldname |
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
| select confrelid::regclass, af.attname as fcol, | |
| conrelid::regclass, a.attname as col | |
| from pg_attribute af, pg_attribute a, | |
| (select conrelid,confrelid,conkey[i] as conkey, confkey[i] as confkey | |
| from (select conrelid,confrelid,conkey,confkey, | |
| generate_series(1,array_upper(conkey,1)) as i | |
| from pg_constraint where contype = 'f') ss) ss2 | |
| where af.attnum = confkey and af.attrelid = confrelid and | |
| a.attnum = conkey and a.attrelid = conrelid | |
| AND confrelid::regclass = 'my_table'::regclass AND af.attname = 'my_referenced_column'; |
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
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "net/url" | |
| "os" | |
| "os/signal" | |
| "strings" |
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
| # Proxy all requests dynamically. Eg: http://127.0.0.1/proxy/192.168.1.1/foo/bar >> http://192.168.1.1/foo/bar | |
| location ~ "^/proxy/([^/]*)/(.*)$" { | |
| proxy_pass $scheme://$1/$2$is_args$args; | |
| } |
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
| 'use strict'; | |
| /** | |
| * ui-ladda | |
| * | |
| * To use, simply use normal Ladda classes and attributes and pass a model to ui-ladda. You can | |
| * use truthy or falsey values, or pass decimals from 0 to 1 to show the progress bar animation. | |
| * | |
| * | |
| * @param uiLadda (mixed): Sets wether or not to show the ladda loading |
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
| //take this script and place it in your firebug or javascript console (when you are on the invoice edit page) | |
| //it will segment billable and non-billable (0.00) and total them up (could be improved to group by rate) | |
| var total=0; | |
| function add_them(index, e){ | |
| var num = parseFloat($(e).val()); | |
| if (!isNaN(num)) { | |
| total += num; | |
| } | |
| } |
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
| <?php | |
| /** | |
| * Github WebHook processor | |
| * POST to: postreceive.php?key=REPLACE_ME_WITH_A_UNIQUE_KEY | |
| * | |
| * @author Luis Abreu | |
| * @version 0.1 | |
| * @copyright Quodis, 24 February, 2011 | |
| * @package default |
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
| uname='BOBDOBBS' | |
| pwd='3n*90!23nl1' | |
| sedEncode='s/%/%25/g;s/ /%20/g;s/ /%09/g;s/!/%21/g;s/"/%22/g;s/#/%23/g;s/\$/%24/g;s/\&/%26/g;s/'\''/%27/g;s/(/%28/g;s/)/%29/g;s/\*/%2a/g;s/+/%2b/g;s/,/%2c/g;s/-/%2d/g;s/\./%2e/g;s/\//%2f/g;s/:/%3a/g;s/;/%3b/g;s//%3e/g;s/?/%3f/g;s/@/%40/g;s/\[/%5b/g;s/\\/%5c/g;s/\]/%5d/g;s/\^/%5e/g;s/_/%5f/g;s/`/%60/g;s/{/%7b/g;s/|/%7c/g;s/}/%7d/g;s/~/%7e/g;s/ /%09/g' | |
| encodedUname=$(echo "$uname" | sed "$sedEncode") | |
| encodedPwd=$(echo "$pwd" | sed "$sedEncode") | |
| repoStr="http://$encodedUname:$encodedPwd@github.com/fnord/five-tons-of-flax.git" | |
| cd ~/ | |
| git clone "$repoStr" |