Skip to content

Instantly share code, notes, and snippets.

View piscis's full-sized avatar
🧱
¯\_(ツ)_/¯

Alex piscis

🧱
¯\_(ツ)_/¯
View GitHub Profile
@piscis
piscis / gist:5394829
Last active December 16, 2015 06:58
bind piler compat with express 3.x socket.io
// Install: express 3.x, socket.io 0.9.x, piler-compat
var express = require('express');
var app = express();
var piler = require('piler-compat');
var http = require('http');
var socketio = require('socket.io');
// Express
app.configure(function(){
//... express config
@piscis
piscis / gist:7384954
Created November 9, 2013 12:30
Setup Ubuntu KVM VM with vmbuilder
vmbuilder kvm ubuntu -v \
--suite=precise \
--libvirt=qemu:///system \
--arch=amd64 --cpus=2 --mem=4024 --swapsize=4096 --rootsize=1204800 \
--flavour=virtual \
--hostname=XXXX \
--ip=XXX.XXX.XXX.XXX \
--mask=XXX.XXX.XXX.XXX \
--net=XXX.XXX.XXX.XXX \
--bcast=XXX.XXX.XXX.XXX \
@piscis
piscis / css
Last active August 29, 2015 13:57
Compare SASS/SCSS/CSS base syntax
.block-content img.img-thumbnail {
width: 35%;
}
.block-content img.img-thumbnail.pull-left {
margin-right: 8px;
}
.block-content img.img-thumbnail.pull-rigth {
margin-left: 8px;
}
@piscis
piscis / SassMeister-input.sass
Created March 6, 2014 10:06
Generated by SassMeister.com.
// ----
// Sass (v3.2.14)
// Compass (v0.12.2)
// ----
@import "compass"
.foobar
+scale(1)
+opacity(0)
@piscis
piscis / gist:3b3df53241fdbb859c07
Last active September 15, 2018 16:01
MongoDB: Drop all indexes on all collections in one database
db.getCollectionNames().forEach( function (d) {
db[d].dropIndexes();
});
db.tilezoom_source.chunks.ensureIndex( { files_id: 1, n: 1 }, { unique: true } );
db.tilezoom_artefacts.chunks.ensureIndex( { files_id: 1, n: 1 }, { unique: true } );
db.mosaic_artefact.chunks.ensureIndex( { files_id: 1, n: 1 }, { unique: true } );
db.mosaic_artefact_index.chunks.ensureIndex( { files_id: 1, n: 1 }, { unique: true } );
<?php if ( ! defined( 'WPINC' ) ) die;
/**
* Represents the view for the public-facing component of the plugin.
*
* This typically includes any information, if any, that is rendered to the
* frontend of the theme when the plugin is activated.
*
* @package FlowFlow
* @author Looks Awesome <[email protected]>
* @link http://looks-awesome.com
....
features = [List-with-FeaturePoints-generated-on-the-client]
vectorSource = new ol.source.GeoJSON(({
"object":
"type": "FeatureCollection"
"features": features
}));
vectorLayer = new ol.layer.Image({"source": new ol.source.ImageVector(
@piscis
piscis / gist:0efa5d20da1a02799ca1
Created February 23, 2015 18:07
Typescript 2 Javascript
module Parallax {
export class ParallaxContainer {
private content: HTMLElement;
private perspective: number;
private surface: ParallaxSurface[];
/**
* Creates a Container for a Parallax
*
* @param {HTMLElement} scrollableContent The container that will be parallaxed
@piscis
piscis / gist:eaec26b3ea6b0a6fa94a
Last active August 29, 2015 14:16
Traverse JSON Object
var obj = {
a:1,
b: {
c:2
},
d: [1,2,3,4]
};
function process(key,value) {
console.log(key,value)
# Created by https://www.gitignore.io
### PhpStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
*.iml
## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following: