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
class Person { | |
constructor(name) { this.name = name.toString() } | |
be_polite() { return `Good morning, ${this.name}.` } | |
be_rude() { return `Actually, Jump off of something high.` } | |
} | |
const me = new Person("Dave") | |
me | |
|> be_polite | |
|> be_rude |
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
atom-text-editor { | |
background-color: rgb(251, 244, 239); | |
&::shadow { | |
.gutter { | |
background-color: rgb(251, 244, 239); | |
} | |
.gutter, | |
.comment, |
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
package model | |
import ( | |
"fmt" | |
"io" | |
"os" | |
"github.com/go-gl/mathgl/mgl32" | |
) |
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
var op = db.currentOp().inprog[0]; | |
var persec = op.progress.done / op.secs_running; | |
var time = ((op.progress.total - op.progress.done) / persec) / 60 / 60; | |
var unit = 'hours'; | |
if (time < 1.0 && time > 0.0) { | |
unit = 'minutes'; | |
time = 60 * time; | |
} |
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
db.currentOp().inprog.forEach(function(op) { | |
if (op.progress) { | |
var remaining = op.progress.total - op.progress.done; | |
var running_for = op.secs_running / 60 / 60; | |
print(op.ns, op.opid, 'running for', running_for.toPrecision(4), 'hours') | |
print('job "'+ op.insert.name +'" running in background?', op.insert.background ? 'yes' : 'no'); | |
print(op.msg) | |
print('Remaining records', remaining, 'finished', op.progress.done, 'docs') | |
print('Estimated', ((running_for / op.progress.done) * remaining).toPrecision(4), 'hours remaining') |
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
<ifModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule (.*) /index.html [QSA,L] | |
</ifModule> |
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
The MIT License (MIT) | |
Copyright (c) 2014 Dave Mackintosh | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to | |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
the Software, and to permit persons to whom the Software is furnished to do so, | |
subject to the following conditions: |
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
Gol = class() | |
function Gol:init(W, H) | |
-- Set the size | |
self.columns = W | |
self.rows = H | |
-- The varying states of cells | |
self._alive = 1 | |
self._dead = 0 |
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
#!/bin/sh | |
# | |
# An example hook script to verify what is about to be committed. | |
# Called by "git commit" with no arguments. The hook should | |
# exit with non-zero status after issuing an appropriate message if | |
# it wants to stop the commit. | |
# | |
# To enable this hook, rename this file to "pre-commit". | |
if [ $(git rev-parse --abbrev-ref HEAD) == "master" ]; then |
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
function colourFade (start, end, steps) { | |
var steps = steps || 10; | |
var start = start ? start.replace('#', '') : '000000' | |
var end = end ? end.replace('#', '') : 'FFFFFF' | |
var out = {"r":[],"g":[],"b":[]}; | |
var floor = Math.abs; | |
console.log(start,end,end.substr(2,4)); |