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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |
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
function consolidateImageWMSLayers (layers) { | |
let i, j | |
const layersProcessed = [] // need to record processed layers to only process once | |
const layersToConsolidate = [] // intended to contain arrays of layer that are to be consolidated | |
const otherIndices = [] // indices of unconsolidated layers, will be used when assembling new layers | |
const isImageWMS = layer => layer.type === 'Image' && layer.source.type === 'ImageWMS' | |
const isProcessed = layer => layersProcessed.indexOf(layer) !== -1 | |
const isCandidate = (l1, l2) => l1.source.url === l2.source.url && !(l1.metadata.unconsolidated === true || l2.metadata.unconsolidated === true) |
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
<?xml version='1.0'?> | |
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> | |
<fontconfig> | |
<match target="font"> | |
<edit mode="assign" name="rgba"> | |
<const>rgb</const> | |
</edit> | |
</match> | |
<match target="font"> | |
<edit mode="assign" name="hinting"> |
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
-- source is in 4326 | |
drop table osm.land_polygons_3006; | |
create table osm.land_polygons_3006 (gid serial primary key, geom geometry(Polygon,3006)); | |
with transformed_subset1 as ( | |
select ST_Transform(ST_ClipByBox2D(geom, ST_MakeEnvelope(0, 40, 50, 75, 4326)), 3006) as geom from osm.land_polygons | |
), subset2 as ( | |
select ST_ClipByBox2D(geom, ST_MakeEnvelope(-350000, 5600000, 1870000, 7980000, 3006)) as geom from transformed_subset1 where ST_IsEmpty(geom) is false | |
) | |
insert into osm.land_polygons_3006 (geom) select (ST_Dump(ST_SubDivide(geom, 1000))).geom from subset2 where ST_IsEmpty(geom) is false; |
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
CREATE OR REPLACE FUNCTION osm.split_polygon(polygon geometry, level integer) | |
RETURNS SETOF geometry AS | |
$BODY$ | |
DECLARE | |
num_points int; | |
mid double precision; | |
envelope geometry; | |
b1 geometry; | |
b2 geometry; | |
geom1 geometry; |
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
-- Function: gkdb.repairgeom(geometry) | |
-- DROP FUNCTION gkdb.repairgeom(geometry); | |
CREATE OR REPLACE FUNCTION gkdb.repairgeom(polygon geometry) | |
RETURNS geometry AS | |
$BODY$ | |
DECLARE | |
linework geometry; |
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
package org | |
import org.bukkit.plugin.java.JavaPlugin | |
import com.mchange.v2.c3p0.ComboPooledDataSource | |
class ArkdesPlugin extends JavaPlugin { | |
val cpds = new ComboPooledDataSource() | |
cpds.setDriverClass("org.postgresql.Driver") | |
cpds.setJdbcUrl("jdbc:postgresql:test") |
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
// bad/lazy Java, too nested... should implement callback classes separately, but that also feels like overkill and leads to macaroni code | |
// other crap parts is that all interface methods needs implementation and ugly override annotations. | |
scene.setOnAreaTouchListener(new IOnAreaTouchListener() { | |
@Override | |
public boolean onAreaTouched(TouchEvent pSceneTouchEvent, ITouchArea pTouchArea, float pTouchAreaLocalX, float pTouchAreaLocalY) { | |
if (pSceneTouchEvent.isActionDown()) { | |
scene.registerEntityModifier(new DelayModifier(1.0f, new IEntityModifierListener() { | |
@Override | |
public void onModifierStarted(IModifier<IEntity> pModifier, IEntity pItem) { | |
} |
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
/* | |
* @requires two/Two.js | |
*/ | |
function One() { } | |
Two.prototype = new Two(); |
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
val a = Vector.fill(64){true} | |
val b = Vector.fill(64){false} | |
val c = b.updated(10, true) | |
a zip c foreach { case (ae, ce) => if (ce) ae = false } |