This file contains hidden or 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 | |
/* | |
This is a simple automagic MySQL wrapper which provides basic protection from SQL injections. | |
Usage (after you change database parameters on line 19): | |
require_once("db.php"); //in whichever script you want to run SQL code | |
... | |
$result = execute_sql("SELECT userId, userName, userAvatar FROM users WHERE username = ? AND email = ?", [$username, $email]); | |
foreach($result as $row) | |
echo $row["userId"].";".$row["userAvatar"]; | |
This file contains hidden or 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/python3 | |
import os, json, urllib, requests, csv | |
def html2csv(html): | |
from bs4 import BeautifulSoup | |
soup = BeautifulSoup(html, features="html.parser") | |
table = soup.find("table") | |
headers = [th.text.strip() for th in table.select("tr th")] | |
with open("out.csv", "w") as f: |
This file contains hidden or 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
meta: | |
id: pes20_player_bin | |
file-extension: bin | |
endian: le | |
encoding: UTF-8 | |
seq: | |
#- size: 8 | |
- id: body | |
type: body | |
# size: _io.size - 8 |
This file contains hidden or 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/bash | |
pv backup.sql.gz | gunzip | mysql --max_allowed_packet=1GM -u root -p table_name |
This file contains hidden or 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 -S bash -e | |
set -o xtrace | |
function set_gnome_configuration { | |
# Disable Gnome animations | |
gsettings set org.gnome.desktop.interface enable-animations false | |
# Dock settings | |
gsettings set org.gnome.shell.extensions.dash-to-dock show-apps-at-top true |
This file contains hidden or 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 -S bash -e | |
set -o xtrace | |
set -e | |
WORK=${WORK-0} | |
function set_gnome_configuration { | |
# Configure power settings | |
dconf write /org/gnome/desktop/session/idle-delay "uint32 0" |
OlderNewer