Skip to content

Instantly share code, notes, and snippets.

View amekusa's full-sized avatar
🏠
Working from home

amekusa amekusa

🏠
Working from home
View GitHub Profile
// SomeClass.js
class SomeClass {
constructor() {
}
}
export default SomeClass
// index.js
import SomeClass from './SomeClass.js'
let x = new SomeClass()
# ----------------- ---- -- -
# Custom Settings
# From 2020.04.23
# Anonymize
visible_hostname none
forwarded_for off
via off
# Remove some HTTP headers
@amekusa
amekusa / .gitignore_global
Last active April 19, 2020 05:40
Global .gitignore
# Global .gitignore
#
# To take effect, place this file on your home dir and run this command:
# $ git config --global core.excludesfile ~/.gitignore_global
#
# Created by https://www.gitignore.io/api/node,linux,macos,windows,eclipse
# Edit at https://www.gitignore.io/?templates=node,linux,macos,windows,eclipse
### Eclipse ###
@amekusa
amekusa / dynamic-getter-setter.php
Last active November 23, 2018 05:31
Dynamic getter/setter implementation for PHP
<?php
/**
* Example class
*/
class Dog {
private $name, $breed, $age;
public function __call($Fn, $Args) {
$act = substr($Fn, 0, 3);
@amekusa
amekusa / my-php.ini
Last active February 12, 2022 07:47
PHP Good Practice
; Custom PHP Settings
; --------------------- ---- -- -
; Place this file in: /etc/php/conf.d
;memory_limit = 128M
memory_limit = 512M
; Fix "JIT compilation failed" in PHP 7.3
pcre.jit=0
@amekusa
amekusa / rkhunter-propupd.hook
Last active October 21, 2022 03:10
Rkhunter Setup
# dir: /etc/pacman.d/hooks/
[Trigger]
Operation = Upgrade
Type = Package
Target = *
[Action]
Description = rkhunter --propupd
When = PostTransaction
@amekusa
amekusa / mapcrafter.service
Last active July 31, 2017 05:49
Minecraft Server Settings
[Unit]
Description=Minecraft World Map Renderer
[Service]
Type=oneshot
ExecStart=/usr/bin/nice -n 10 /usr/bin/mapcrafter -c /etc/mapcrafter/render.conf
@amekusa
amekusa / certbot.service
Last active July 11, 2017 14:18
Let's Encrypt Auto Renewal
[Unit]
Description=Let's Encrypt renewal
[Service]
Type=oneshot
ExecStart=/usr/bin/certbot renew --pre-hook "/usr/bin/systemctl stop nginx.service" --post-hook "/usr/bin/systemctl start nginx.service" --quiet --agree-tos
ExecStartPost=/bin/systemctl reload nginx.service
@amekusa
amekusa / .gitignore
Created February 25, 2017 10:02
Global .gitignore
# ------------------------------------------------ ---- -- -
# This is global .gitignore
# Place this on your home directory And run this command:
# git config --global core.excludesfile ~/.gitignore
# -------------------------------- ---- -- -
# Created by https://www.gitignore.io/api/eclipse,vim,macos,linux,windows,archives
### Archives ###
# It's better to unpack these files and commit the raw source because
@amekusa
amekusa / server.nginx.conf
Created August 7, 2016 09:04
Dynamic Virtual Hosts
server {
listen 80;
# listen on the www host
server_name ~^(www\.)(?<domain>.+)$;
# and redirect to the non-www host (declared below)
return 301 $scheme://$domain$request_uri;
}