Skip to content

Instantly share code, notes, and snippets.

View AntJanus's full-sized avatar

Antonin Januska AntJanus

View GitHub Profile
@AntJanus
AntJanus / gist:390d56a28c2e7617c766c726478692e6
Last active September 17, 2019 03:54 — forked from molovo/gist:6907965
A short snippet for exporting posts from Anchor CMS into separate .markdown files for use with Jekyll. Just add the created files straight into your _posts folder in jekyll. The following code goes into /anchor/routes/site.php, then just visit <site URL>/export to create the files
Route::get('export', function() {
$posts = Post::where('status', '=', 'published')->get();
foreach ($posts as $post) {
$category = Category::where('id', '=', $post->category)->get()[0]->title;
$content = <<<EOD
---
layout: post
title: "$post->title"
date: $post->created
interface Callback {
(data: any, error: string): any
}
export function getUserId(id, callback: Callback) {}
// weird method 1
function someAction() {
return fetchData()
.then(data => {
return cumulativePromise([data], fetchOtherData());
})
.then(accumulation => {
var fetchedData = accumulation[0];
var fetchedOtherData = accumulation[1];
@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%'
@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
.button {
color: () => this.hover ? 'green' : 'red';
padding: 15px;
content: () => {
return (
<button>{this.innerText}</button>
);
};
text-align: () => {
this.attrs.href.contains('#') ? 'left' : 'right';

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:

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) => {
'use strict';
class test {
constructor() {
alert();
}
}
var t = new test();
function anim() {
window.requestAnimationFrame(anim);
GAME.run();
}
anim();