This file contains 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
// Include this at the very top of both your main and window processes, so that | |
// it loads as soon as possible. | |
// | |
// Why does this work? The node.js module system calls fs.realpathSync a _lot_ | |
// to load stuff, which in turn, has to call fs.lstatSync a _lot_. While you | |
// generally can't cache stat() results because they change behind your back | |
// (i.e. another program opens a file, then you stat it, the stats change), | |
// caching it for a very short period of time is :ok: :gem:. These effects are | |
// especially apparent on Windows, where stat() is far more expensive - stat() | |
// calls often take more time in the perf graph than actually evaluating the |
This file contains 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
<?php | |
class StringPlus { | |
public $str = ''; | |
public function __construct($string) { | |
// Convert booleans | |
if ( $string === true ) { | |
$this->str = "true"; | |
} else if ($string === false) { | |
$this->str = "false"; |
This file contains 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 xyz.mycharlie.colourhistogram; | |
import java.awt.*; | |
import java.awt.image.*; | |
import java.io.*; | |
import javax.imageio.*; | |
public class Main { | |
public int[][] createRGBData(BufferedImage img) { | |
int[] R=new int[256], G=new int[256], B=new int[256]; |
This file contains 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
[root@plex ~]# cat /etc/systemd/system/[email protected] | |
[Unit] | |
Description=Minecraft Server %i | |
[Service] | |
WorkingDirectory=/opt/minecraft-%i | |
User=mcserver | |
Type=forking | |
ExecStart=/usr/bin/tmux new-session -s mc-%i -d '/bin/java -Xmx2048M -jar minecraft_server.jar nogui' |
This file contains 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
cd git | |
git clone [email protected]:C-Bouthoorn/SpeedProgramming.git | |
cd .. | |
mkdir lighttpd | |
cp ./git/SpeedProgramming/lighttpd/* . |
This file contains 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
#!/usr/bin/env python | |
# Python 3.5 or greater, but probably backportable with minimal effort. | |
"""Creates dense crossword puzzle fills. | |
This module provides code to fill dense cross-word puzzles. It is a work | |
in progress. | |
We represent words in a puzzle as a square matrix of bytes. |