Skip to content

Instantly share code, notes, and snippets.

View padewitte's full-sized avatar

DEWITTE Pierre-Alban padewitte

View GitHub Profile
@matthewp
matthewp / decorate-element.js
Last active April 23, 2020 07:57
decorate-element
function decorate(tag, template) {
customElements.define(tag, class extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
}
connectedCallback() {
let root = this.shadowRoot;
if(!root.firstChild) {
/**
* An approximate port of https://github.com/s-macke/VoxelSpace
* using Kotlin and JavaFX.
*
* Run with : kotlinc -script voxel.kts
*
* Click on the panel to "fly".
*
* Twitter: @CedricChampeau
*/
@glaforge
glaforge / groovy-xmas.txt
Created December 29, 2015 13:38
Some Groovy Xmas poetry
So as we bring closure on twenty-15
@grab your maven by its j-bean
Swing those builders for a laugh
But only on their own classpath
Have you...
Met a class with a trait?
Got your binding way too late?
Seen Elvis looking like ?:
Or lost your way in recursion
// kills long running ops in MongoDB (taking seconds as an arg to define "long")
// attempts to be a bit safer than killing all by excluding replication related operations
// and only targeting queries as opposed to commands etc.
killLongRunningOps = function(maxSecsRunning) {
currOp = db.currentOp();
for (oper in currOp.inprog) {
op = currOp.inprog[oper-0];
if (op.secs_running > maxSecsRunning && op.op == "query" && !op.ns.startsWith("local")) {
print("Killing opId: " + op.opid
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active December 31, 2025 22:19
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname