Skip to content

Instantly share code, notes, and snippets.

View sscholl's full-sized avatar

Simon Eric Scholl sscholl

View GitHub Profile
@jhass
jhass / diaspora.conf
Last active March 12, 2021 13:18
Advanced Diaspora Apache reverse proxy
# Make sure to notice the comments at https://gist.github.com/jhass/719014#gistcomment-19774
<VirtualHost *:80>
ServerName diaspora.example.org
ServerAlias www.diaspora.example.org
RedirectPermanent / https://diaspora.example.org/
</VirtualHost>
<VirtualHost *:443>
ServerName diaspora.example.org
@chuckreynolds
chuckreynolds / wordpress-change-domain-migration.sql
Last active February 10, 2023 18:56
UPDATE: Use WP-CLI find-replace command to edit URLs in your database. https://developer.wordpress.org/cli/commands/search-replace/ Use this SQL script when changing domains on a WordPress site. Whether you’re moving from an old domain to a new domain or you’re changing from a development domain to a production domain this will work. __STEP1: al…
/* Use WP-CLI instead https://developer.wordpress.org/cli/commands/search-replace/ */
SET @oldsite='http://oldsite.com';
SET @newsite='http://newsite.com';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
/* only uncomment next line if you want all your current posts to post to RSS again as new */
@avdg
avdg / engine.js
Last active February 2, 2024 20:27
Decompilation screeps engine.js (as of Tue Nov 24 2015 14:12:26 GMT+0100 (Romance (standaardtijd)))
var global = self;
var Reflect = {
global: global
};
!function a(b, c, d) {
function e(g, h) {
if (!c[g]) {
if (!b[g]) {
@avdg
avdg / terrain.js
Created July 13, 2015 22:32
Just blah
'use strict';
// TODO use high performance array?
var types = {
plain: 0,
swamp: 1,
lava: 2,
wall: 3
};
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@laverdet
laverdet / terrain.js
Created April 6, 2016 00:35
parse terrain from screeps png
getPx('https://s3.amazonaws.com/static.screeps.com/map2/'+ roomName+ '.png', function(err, pixels) {
if (err) {
throw err;
}
let kyskip = 50 * 3 * 3 * 4;
let kxskip = 3 * 4;
for (let yy = 0; yy < 50; ++yy) {
for (let xx = 0; xx < 50; ++xx) {
let px = pixels.data[xx * kxskip + yy * kyskip] * 0x10000 + pixels.data[xx * kxskip + yy * kyskip + 1] * 0x100 + pixels.data[xx * kxskip + yy * kyskip + 2];
switch (px) {
@AmShaegar13
AmShaegar13 / outdated_files_query.js
Last active April 17, 2024 15:34
Delete outdated files from Rocket.Chat
/**
* MongoDB query to delete outdated files from Rocket.Chat. You can specify the number of DAYS
* before a file is considered outdated. Deleted files are removed from GridFS completely keeping
* only the message in chat. The message is modified to be a link that points to ALT_LINK instead
* of the file and '(deleted)' is appended to the title.
*
* Tested with MongoDB 3.4
*/
const DAYS = 60;