Skip to content

Instantly share code, notes, and snippets.

View Areso's full-sized avatar
🎯
Writing a game for Steam Game Festival

Anton Gladyshev Areso

🎯
Writing a game for Steam Game Festival
View GitHub Profile
@Areso
Areso / parse-url-params.js
Created September 4, 2018 02:42 — forked from lacymorrow/parse-url-params.js
JS - Parse URL `GET` parameters from and HTTP request
/* function parseURLParams
* Accepts a http parameter string or grabs the one from the current URL
* Returns a dictionary
* Ex: '?api_key=XYZ&version=2' => { api_key: 'XYZ', version: 2}
*
* query: string | undefined
*/
function parseURLParams (query) {
if(!query)
@Areso
Areso / do-fontdetect.js
Created September 12, 2018 18:59 — forked from szepeviktor/do-fontdetect.js
JavaScript/CSS Font Detector by Lalit Patel
// loading on "load" may cause FOUC
window.onload = function() {
var detective = new Detector();
if (!detective.detect('Meat')) {
var url = 'link/to/style.css'
if (document.createStyleSheet) {
try { document.createStyleSheet(url); } catch (e) { }
} else {
var css;
@Areso
Areso / python_sql.py
Created June 14, 2019 21:28 — forked from codephillip/python_sql.py
Sql commands in python
import mysql.connector
mydb = mysql.connector.connect(
host="127.0.0.1",
user="root",
passwd="XXXXXX"
)
@Areso
Areso / index.html
Last active August 30, 2019 07:33
Base IDLE game in 81 lines
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>
Base IDLE game example
</title>
<style>
</style>
</head>
<body>
@Areso
Areso / test
Created October 7, 2019 14:01
test
test
@Areso
Areso / post.html
Created January 23, 2020 19:01
send post data
$(function(){
$('form').submit{
document.sessionStorage["form-data"] = $('this').serialize();
document.location.href = 'another-page.html';
}
});
Expand snippet
At another-page.html:
var formData = document.sessionStorage["form-data"];
@Areso
Areso / 1_centos_basic.sh
Last active January 13, 2021 19:08
centos_basic
yum install -y python3
yum install -y git
yum install -y nano
yum install -y bzip2
python3 -m pip install ansible
python3 -m pip install virtualenv
python3 -m pip install selinux
ansible-galaxy install galaxyproject.galaxy
@Areso
Areso / dockergrep.sh
Created June 21, 2021 12:41 — forked from roylee0704/dockergrep.sh
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@Areso
Areso / systemctl.txt
Created February 8, 2022 09:47
systemctl
systemctl edit --force --full newservicename.service
```
[Unit]
Description=backend
Requires=network.target
[Service]
Type=oneshot
Restart=yes
RestartSec=120
@Areso
Areso / test
Created February 9, 2022 10:11
test
eyJnb2xkIjo2MjY1LCJnZW1zIjowLCJwb3AiOjQ1MCwic2Vhc29uIjoxLCJ5ZWFyIjoxMzY0LCJmb29kIjoyMCwidHJlYXN1cnlHdWFyZCI6NSwiYnVpbGRMZXZlbEQiOjMsImJ1aWxkTGV2ZWxIIjoxMywiYnVpbGRMZXZlbFRyZWFzdXJ5IjozLCJidWlsZExldmVsR2FsbG93cyI6MCwiYnVpbGRMZXZlbEZvdW50YWluIjoxLCJidWlsZExldmVsU3Rhc2giOjEsImJ1aWxkTGV2ZWxJbm4iOjIsImJ1aWxkTGV2ZWxTdGFibGUiOjIsImJ1aWxkTGV2ZWxBcmNoZXJ5IjoyLCJidWlsZExldmVsU21pdGgiOjAsImZpcmUiOjAsImZpcmVTdGVwcyI6MCwiZmlyZUd1YXJkIjowLCJoZXJvIjowLCJoYXBwaW5lc3MiOjgwLCJvX2F1dG9zYXZlIjoxLCJuZXdTYXZlVmVyc2lvbiI6OCwic2F2ZVZlcnNpb24iOiJzYXZlVjEwMTAiLCJjYXN0bGVYIjoxNiwiY2FzdGxlWSI6NCwiaGVyb1giOjAsImhlcm9ZIjo4LCJtYXBDcmVhdGVkIjoxLCJteU1hcExhbmQiOltbMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDBdLFswLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMF0sWzAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwXSxbMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDBdLFswLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMF0sWzAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwXSxbMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDBdLFswLDAsMCwwLDAsMCwwLDAsMCwwLDAs