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
size_t bytesToUTF16Count(size_t bytes) | |
{ | |
if (bytes > text.length) | |
bytes = text.length; | |
size_t offset; | |
size_t index; | |
while (index < bytes) | |
{ | |
switch (text.ptr[index] & 0b1111_0000) |
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
[Unit] | |
Description=new.webfreak.org | |
After=network-online.target mongodb.service | |
[Service] | |
ExecStart=/srv/http/org.webfreak.new/webfreak.org-v3/webfreak-org-3 --vvv | |
Restart=always | |
WorkingDirectory=/srv/http/org.webfreak.new/webfreak.org-v3 | |
User=http | |
Group=http |
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
/** | |
* @fires Event#change when checked is changed | |
* @fires Event#change-mod when mod is changed | |
* @fires Event#next when the mod was left-clicked or selected with enter | |
* @fires Event#prev when the mod was right-clicked | |
*/ | |
export class OsuModCheckbox extends HTMLElement { | |
protected wrapper: HTMLLabelElement; | |
protected cb: HTMLInputElement; | |
protected span: HTMLElement; |
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
module diet2spasm; | |
import diet.defs; | |
import diet.dom; | |
import diet.internal.string; | |
import diet.input; | |
import diet.parser; | |
import diet.traits; | |
/// Compiles diet code to spasm compatible createElement/textContent/setAttribute D code usable for mixin. |
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
/// Implements mozilla's plural forms. | |
/// See_Also: https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_and_Plurals | |
/// Returns: the index which plural word to use. For each rule from top to bottom. | |
int resolvePlural(int form, int n) | |
{ | |
import std.algorithm : among; | |
switch (form) | |
{ | |
// Asian, Persian, Turkic/Altaic, Thai, Lao |
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
for file in *.png | |
echo -n "Optimizing $file..." | |
if zopflipng -y -m $file (basename $file .png)".min.png" | grep "Result is smaller" | |
mv (basename $file .png)".min.png" $file | |
echo " optimized." | |
else | |
rm (basename $file .png)".min.png" | |
echo | |
end | |
end |
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
<application xmlns="urn:schemas-microsoft-com:asm.v3"> | |
<windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings"> | |
<ws2:longPathAware>true</ws2:longPathAware> | |
</windowsSettings> | |
</application> |
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
[ | |
ConstantCompletion("allMembers", "$(P Takes a single argument, which must evaluate to either | |
a type or an expression of type. | |
A tuple of string literals is returned, each of which | |
is the name of a member of that type combined with all | |
of the members of the base classes (if the type is a class). | |
No name is repeated. | |
Builtin properties are not included. | |
) |
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
module d_to_html; | |
import std.conv; | |
import std.stdio; | |
import std.traits; | |
import std.range; | |
struct Element | |
{ | |
string _name; |
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
#!/bin/sh | |
id=`date +%Y-%m-%d_%H-%M` | |
# Creates a backup of a website + database in a .tar.gz file | |
# Archive structure: | |
# db.sql | |
# website_folder/ | |
# Name of backup | |
appname="mywebsite" |