Skip to content

Instantly share code, notes, and snippets.

@ailabs-software
ailabs-software / gist:697f36b47c1fff692c30e2c17eaa78f3
Created August 9, 2017 18:55
1500ms query on 7 million row table
EXPLAIN ANALYZE SELECT page_url, page_title, COUNT(*)::int FROM siteanalytics_pageview
WHERE domain=143 AND ( pageview_timestamp::date >= '7/10/2017'::date AND pageview_timestamp::date <= '8/9/2017'::date )
GROUP BY page_url, page_title ORDER BY count DESC LIMIT 10;
CKEDITOR.on('dialogDefinition', function(ev) {
if (ev.data.name == "link") {
var info = dialog.getContents("info");
info.elements.push({
type: "vbox",
id: "urlOptions",
children: [{
type: "hbox",
children: [{
id: "button",
@ailabs-software
ailabs-software / gist:5bd04b0a25565351221dd98a2c7d568b
Created June 21, 2017 14:52
TypeScript changing of type by localscope
var obj: Object = new Object();
class Puppet
{
public doTheatricalPuppet(): void
{
}
}
var DEFAULT_ACTIVE_FIELDS;
var Lpipelinesystem_dataservice_PipelineDAL_2_classLit = createForClass('pipelinesystem.dataservice', 'PipelineDAL', 169);
function $compare_1(this$static, s1, s2){
var s1_rank, s2_rank;
s1_rank = $rankItem(this$static, s1);
s2_rank = $rankItem(this$static, s2);
if (s1_rank > s2_rank) {
return 1;
}
else if (s1_rank < s2_rank) {
public enum CardinalDirectionType
{
North ("n-resize", new Coordinate(100, 0) ),
NorthEast ("ne-resize", new Coordinate(100, 0) ),
East ("e-resize", new Coordinate(100, 50) ),
SouthEast ("se-resize", new Coordinate(100, 100) ),
South ("s-resize", new Coordinate(50, 100) ),
SouthWest ("sw-resize", new Coordinate(0, 100) ),
West ("w-resize", new Coordinate(0, 50) ),
NorthWest ("nw-resize", new Coordinate(0, 0) );
public enum CardinalDirectionType
{
North ("n-resize"),
NorthEast ("ne-resize"),
East ("e-resize"),
SouthEast ("se-resize"),
South ("s-resize"),
SouthWest ("sw-resize"),
West ("w-resize"),
NorthWest ("nw-resize");
@ailabs-software
ailabs-software / URI.ts
Created June 2, 2017 02:17
Port of Closure's URI class to TypeScript
import goog = require("/AILabsToolkit/TClosure/goog");
import array = require("/AILabsToolkit/TClosure/array");
import asserts = require("/AILabsToolkit/TClosure/asserts");
import strings = require("/AILabsToolkit/TClosure/string/strings");
import structs = require("/AILabsToolkit/TClosure/structs");
import Map = require("/AILabsToolkit/TClosure/structs/Map");
import utils = require("/AILabsToolkit/TClosure/uri/utils");
// Copyright 2006 The Closure Library Authors. All Rights Reserved.
//
package ailabs.jclosure.client.encoding;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/** @fileoverview The Serializable annotation. */
@Retention(RetentionPolicy.RUNTIME)
public @interface Serializable
{
package ailabs.jclosure.client.encoding;
import java.util.Set;
import java.util.LinkedHashSet;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.element.TypeElement;
@ailabs-software
ailabs-software / jstack_dump_javaproc.txt
Created April 27, 2017 04:39
GWT compiler threaddump
2017-04-27 00:36:59
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.111-b14 mixed mode):
"Attach Listener" #27 daemon prio=9 os_prio=0 tid=0x00007fe768001000 nid=0xeb57 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"In-process PermutationWorker 0" #26 prio=5 os_prio=0 tid=0x00007fe7986af000 nid=0xeb1d runnable [0x00007fe77a52c000]
java.lang.Thread.State: RUNNABLE
at java.util.HashMap.getNode(HashMap.java:571)
at java.util.LinkedHashMap.get(LinkedHashMap.java:440)