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
# http://blog.argteam.com/coding/hardening-node-js-for-production-part-2-using-nginx-to-avoid-node-js-load/ | |
http { | |
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m; | |
proxy_temp_path /var/tmp; | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
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
// prevent the program to close instantly | |
process.stdin.resume(); | |
function exitHandler(options, err) { | |
if (options.cleanup) console.log('clean'); | |
if (err) console.log(err.stack); | |
if (options.exit) process.exit(); | |
} | |
// do something when app is closing |
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 | |
const LOGIN = 'o_1233211233'; | |
const API_KEY = 'R_2131233211234232111112223232323232'; | |
function httpGet(string $url) : string | |
{ | |
if (false === $result = file_get_contents($url)) { | |
throw new RuntimeException('Request failed'); | |
} |
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 DB | |
{ | |
/** | |
* @var \PDO | |
*/ | |
private $pdo; | |
public function __construct(string $dsn, string $username, string $passwd, array $options = []) |
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
import React from 'react' | |
const ProgressBar = ({ height, color, progress }) => { | |
const containerStyle = { | |
position: 'fixed', | |
top: 0, | |
left: 0, | |
padding: 0, | |
margin: 0, | |
width: '100%', |
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 | |
# pacman -S xorg-xprop xorg-xwininfo | |
# i3-get-window-criteria - Get criteria for use with i3 config commands | |
# To use, run this script, then click on a window. | |
# Output is in the format: [<name>=<value> <name>=<value> ...] | |
# Known problem: when WM_NAME is used as fallback for the 'title="<string>"' criterion, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Hello World</title> | |
<script src="https://unpkg.com/react@16/umd/react.production.min.js"></script> | |
<script | |
src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script> |
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
# Shut down the panel first, | |
xfce4-panel --quit | |
# Kill the xfce4 configuration daemon | |
pkill xfconfd | |
# First delete settings for the panel | |
rm -rf ~/.config/xfce4/panel | |
# Clear out the settings for xfconfd |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" | |
content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" | |
content="ie=edge"> | |
<title>Document</title> |
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 { | |
font-size: 16px; | |
--font-smaller: 12px; | |
--font-small: 14px; | |
--font-normal: 16px; | |
--font-big: 18px; | |
--font-bigger: 24px; | |
--font-bigest: 33px; |