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
/* | |
# Put this in root build.gradle | |
buildscript { | |
ext.kotlin_version = '1.1.3-2' | |
repositories { mavenCentral() } | |
dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } | |
} | |
# Then in each project build.gradle where desired: | |
apply from: '../gradle/kotlin.gradle' | |
*/ |
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
/* | |
# Put this in root build.gradle | |
buildscript { | |
ext.kotlin_version = '1.1.2-5' | |
repositories { mavenCentral() } | |
dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } | |
} | |
# Then in each project build.gradle where desired: | |
apply from: '../gradle/kotlin.min.gradle' | |
*/ |
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
// ==UserScript== | |
// @name GitHub Issue Link Title (GHILT) | |
// @version 0.0.1 | |
// @author dirkraft | |
// Must match aggressively due to HTML5 History, which won't trigger Tampermonkey @match. | |
// @match https://github.com/*/* | |
// @grant none | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js | |
// ==/UserScript== |
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
<configuration scan="true"> | |
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |
<!-- encoders are assigned the type | |
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> | |
<encoder> | |
<!-- @formatter:off --> | |
<pattern>%highlight(%-5level) %d{yyyy-MM-dd'T'HH:mm:ss.SSS} %yellow([%thread]) %blue(%logger{36}) %msg%n</pattern> | |
<!-- @formatter:on --> | |
</encoder> | |
</appender> |
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
import org.postgresql.copy.CopyManager | |
import org.postgresql.core.BaseConnection | |
import org.slf4j.LoggerFactory | |
import java.nio.charset.Charset | |
import java.sql.Connection | |
/** Postgres helper to bulk load data into a db as quickly as possible. */ | |
class PgCopy(db: DbAccess) extends Serializable { |
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
""" | |
Print tabular data to a console making a best effort to write one row per line, | |
adjusting column sizes and truncating automatically to fit each row. | |
The main function is `console_table.fmt`. Execute this script to run the sample. | |
https://gist.github.com/dirkraft/f0759cebfd4d4567365c36570f1e3e51 | |
Written against python 3.6.3. Requires pydash (sorry purists, I like this library :D ). |
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
create view index_dupes as | |
SELECT pg_size_pretty(sum(pg_relation_size(sub.idx))::bigint) AS size, | |
(array_agg(sub.idx))[1] AS idx1, | |
(array_agg(sub.idx))[2] AS idx2, | |
(array_agg(sub.idx))[3] AS idx3, | |
(array_agg(sub.idx))[4] AS idx4 | |
FROM ( SELECT pg_index.indexrelid::regclass AS idx, | |
(((((((pg_index.indrelid::text || ' | |
'::text) || pg_index.indclass::text) || ' | |
'::text) || pg_index.indkey::text) || ' |
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
/* | |
Copyright Alex Leone, David Nufer, David Truong, 2011-03-11. kathack.com | |
javascript:var i,s,ss=['http://kathack.com/js/kh.js','http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js'];for(i=0;i!=ss.length;i++){s=document.createElement('script');s.src=ss[i];document.body.appendChild(s);}void(0); | |
*/ | |
var BORDER_STYLE = "1px solid #bbb", | |
CSS_TRANSFORM = null, | |
CSS_TRANSFORM_ORIGIN = null, | |
POSSIBLE_TRANSFORM_PREFIXES = ['-webkit-', '-moz-', '-o-', '-ms-', ''], |
OlderNewer