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
@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
@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