Skip to content

Instantly share code, notes, and snippets.

View AntJanus's full-sized avatar

Antonin Januska AntJanus

View GitHub Profile
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Image Selector</title>
<style>
.centered-row {
width: 1024px;
margin: 1.5em 0;
}
@AntJanus
AntJanus / gist:3070178a2594ad301b14
Last active August 29, 2015 14:03
Using currying to build an assertion library
var assert = function(evaluateFn, variadic) {
return function() {
var args = [].slice.call(arguments, 0, arguments.length - 1);
var msg = arguments[arguments.length - 1];
if(variadic) {
var evaluation = evaluateFn(args);
} else {
var evaluation = evaluateFn(args[0], args[1]);
}
if(evaluation === true ) { return true; }
@AntJanus
AntJanus / 0_reuse_code.js
Created August 6, 2014 19:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
function anim() {
window.requestAnimationFrame(anim);
GAME.run();
}
anim();
'use strict';
class test {
constructor() {
alert();
}
}
var t = new test();
import fs from 'fs';
import path from 'path';
import Promise from 'bluebird';
Promise.promisify(fs);
export default directoryModified(dirPath) {
return fs.readdirAsync(dirPath)
.then((fileListing) => {
return Promise.all(fileListing.map((file) => {

Keybase proof

I hereby claim:

  • I am antjanus on github.
  • I am antjanus (https://keybase.io/antjanus) on keybase.
  • I have a public key whose fingerprint is AED6 5291 2B2D D23B BF00 E4FD F247 D0EC 4BFE 9549

To claim this, I am signing this object:

.button {
color: () => this.hover ? 'green' : 'red';
padding: 15px;
content: () => {
return (
<button>{this.innerText}</button>
);
};
text-align: () => {
this.attrs.href.contains('#') ? 'left' : 'right';
@AntJanus
AntJanus / myst_windowed.hexdiff
Created June 6, 2017 18:34 — forked from bgK/myst_windowed.hexdiff
Windowed mode patch for Myst Masterpiece Edition
# Allow moving the window
00029FEA: 0F E9
00029FEB: 85 1B
00029FEC: 1A 03
00029FED: 03 00
# Prevent the window from maximising by itself
0002A028: E5 DE
0002A029: 00 02
@AntJanus
AntJanus / postgres_queries_and_commands.sql
Created August 11, 2017 20:29 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'