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 | |
pg_dump --column-inserts | php -B '$dir = "sql"; $cur_table = null;' -R ' | |
if (preg_match("/^(INSERT INTO (\w+) \([^)]*\) VALUES )(.*);$/", $argn, $matches)) { | |
$str = ($cur_table !== $matches[2]) ? $matches[1] : ","; | |
$cur_table = $matches[2]; | |
file_put_contents("$dir/$cur_table.sql", "{$str}\n\t{$matches[3]}", FILE_APPEND); | |
}' -E 'foreach(glob("$dir/*.sql") as $f) file_put_contents($f, ";", FILE_APPEND);' |
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 | |
$current_table_insert = null; | |
while ($line = fgets(STDIN)) { | |
if (strpos($line, 'SET ') === 0) { | |
echo $line; | |
} elseif (strpos($line, 'INSERT INTO') === 0) { | |
preg_match('/^(INSERT INTO (\w+) \([^)]*\) VALUES )(.*);$/', $line, $matches); | |
if ($current_table_insert !== null) { | |
echo ($current_table_insert === $matches[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
BEGIN; | |
CREATE OR REPLACE FUNCTION pgst_suffix_table_name(table_name TEXT, suffix TEXT) RETURNS TEXT AS | |
$$ | |
SELECT TEXT (table_name || '_pgst_' || suffix); | |
$$ | |
LANGUAGE sql IMMUTABLE; | |
CREATE OR REPLACE FUNCTION pgst_start_for_table(table_name TEXT) RETURNS void AS |
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 | |
nokogiri entities.xml -e ' | |
# Based on https://github.com/locationtech/udig-platform/blob/4b926e7bd35d4c95ee2b7a4d1c3294cc3c2729a7/docs/src/main/java/docs/ConfluencePage.java#L103 | |
current_pages=%{ | |
//object[ | |
@class="Page" | |
and property[@name="contentStatus" and .="current"] | |
and ( | |
collection[@name="historicalVersions"] |
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
sqlite3 "$HOME/Library/Application Support/Google/Chrome/Default/Cookies" 'select creation_utc, host_key, name, length(encrypted_value) AS value_length, has_expires from cookies where host_key like "%.adobe.com"' > $HOME/Desktop/adobecookies.txt |
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
mmalone@docker> stock.phpunit | |
OK | |
PHPUnit 5.7.4 by Sebastian Bergmann and contributors. | |
............................................................. 61 / 1841 ( 3%) | |
............................................................. 122 / 1841 ( 6%) | |
............................................................. 183 / 1841 ( 9%) | |
............................................................. 244 / 1841 ( 13%) | |
............................................................. 305 / 1841 ( 16%) | |
............................................................. 366 / 1841 ( 19%) |
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
#!/usr/bin/env python3 | |
import random | |
import collections | |
import re | |
class MinesweeperGrid: | |
def __init__(self, size, num_bombs): | |
self.size = size | |
self.num_bombs = num_bombs |
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
{"@_fa":"true","link":[{"@_fa":"true","@ref":"self","@href":"http://api.elsevier.com/content/abstract/scopus_id/84951299285"},{"@_fa":"true","@ref":"author-affiliation","@href":"http://api.elsevier.com/content/abstract/scopus_id/84951299285?field=author,affiliation"},{"@_fa":"true","@ref":"scopus","@href":"http://www.scopus.com/inward/record.url?partnerID=HzOxMe3b\u0026scp=84951299285\u0026origin=inward"},{"@_fa":"true","@ref":"scopus-citedby","@href":"http://www.scopus.com/inward/citedby.url?partnerID=HzOxMe3b\u0026scp=84951299285\u0026origin=inward"},{"@_fa":"true","@ref":"full-text","@href":"http://api.elsevier.com/content/article/eid/1-s2.0-S2221169115002191"}],"prism:url":"http://api.elsevier.com/content/abstract/scopus_id/84951299285","dc:identifier":"SCOPUS_ID:84951299285","eid":"2-s2.0-84951299285","dc:title":"Combined treatment of 3-hydroxypyridine-4-one derivatives and green tea extract to induce hepcidin expression in iron-overloaded \u03b2-thalassemic mice","dc:creator":"Upanan S.","prism:publicat |
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/sh | |
curl -d @- https://ws.isiknowledge.com/cps/xrpc << END | |
<?xml version="1.0" encoding="UTF-8" ?> | |
<request xmlns="http://www.isinet.com/xrpc42" | |
src="app.id=PartnerApp,env.id=PartnerAppEnv,partner.email=EmailAddress"> | |
<fn name="LinksAMR.retrieve"> | |
<list> | |
<!-- WHO'S REQUESTING --> | |
<map> |
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
script GetElementsRule | |
property name : "GetElementsRule" | |
property xpath : "//foo" | |
property elements : {} | |
on apply(xml_element, rule_processor) | |
set elements to elements & xml_element | |
return false | |
end apply |