Skip to content

Instantly share code, notes, and snippets.

View lil5's full-sized avatar

Lucian I. Last lil5

View GitHub Profile
@lil5
lil5 / .rsynconfig.toml
Last active October 26, 2017 16:34
My rsynconfig config file
# defaults
exclude = '.rsync-filter'
flags = "au"
delete = true
# Backups in list under chinese numbers
# yi.1 first backup without films
# yi.4 first backup of films
# er.2 second backup without films
# san third backup without films in external drive
@lil5
lil5 / docker-compose.yml
Created May 16, 2018 07:52
Nextcloud on Docker with self cert HTTPS using omgwtfssl
version: '3'
services:
db:
image: mariadb
restart: unless-stopped
volumes:
- /mnt/data/mysql:/var/lib/mysql
env_file:
- db.env
[AppID 72850, ActionID 2] : LaunchApp changed task to ProcessingInstallScript with ""
wine: /mnt/icedragon/Games/SteamLibrary/steamapps/compatdata/72850/pfx is not owned by you
wine: /mnt/icedragon/Games/SteamLibrary/steamapps/compatdata/72850/pfx is not owned by you
GameAction [AppID 72850, ActionID 2] : LaunchApp changed task to SynchronizingCloud with ""
GameAction [AppID 72850, ActionID 2] : LaunchApp changed task to ProcessingShaderCache with ""
GameAction [AppID 72850, ActionID 2] : LaunchApp changed task to SiteLicenseSeatCheckout with ""
GameAction [AppID 72850, ActionID 2] : LaunchApp changed task to CreatingProcess with ""
GameAction [AppID 72850, ActionID 2] : LaunchApp waiting for user response to CreatingProcess ""
GameAction [AppID 72850, ActionID 2] : LaunchApp continues with user response "CreatingProcess"
Opted-in Controller Mask: 70
@lil5
lil5 / webdav-copy.sh
Last active February 6, 2019 15:57
Webdav equivalent to `rsync -ar --delete remote/folder ./local/`, Copies from Webdav and only sends changes, One way sync
#!/bin/bash
read -s PASS
if [[ -z $PASS ]]; then
echo 'blank password'
exit 1
fi
USER='user'
@lil5
lil5 / example.sql
Created March 5, 2019 15:28
SQL Refrence
SELECT department.dept_id AS dept_id, COUNT(employee.dept_id) AS count, SUM(employee.salary) AS sum_of_salary
FROM department
INNER JOIN employee ON department.dept_id = employee.dept_id
GROUP BY department.dept_id
ORDER BY department.dept_id ASC

Keybase proof

I hereby claim:

  • I am lil5 on github.
  • I am lilast (https://keybase.io/lilast) on keybase.
  • I have a public key ASB6N8iynthzZiEE7jnFZba19VBFzPdLC3lvKlBiqxQKMQo

To claim this, I am signing this object:

const copyToClipboard = str => {
const el = document.createElement('textarea');
el.value = str;
el.setAttribute('readonly', '');
el.style.position = 'absolute';
el.style.left = '-9999px';
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
@lil5
lil5 / build-scss.bash
Created August 18, 2020 09:29
Build SCSS
#!/bin/bash
for file in $(find . -path ./node_modules -prune -false -o -name "*.scss")
do npx sass ${file}:${file%.scss}.css;
echo $file
done
@lil5
lil5 / get-obj.ts
Last active September 15, 2020 11:21
Typescript Utils
export function getObj<V>(getObj: () => V): V | undefined {
let value: undefined | V;
let shouldReturnUndefined: boolean = false;
try {
value = getObj();
} catch (e) {
if (e instanceof TypeError) {
shouldReturnUndefined = true;
}
}
@lil5
lil5 / enum-reflection.ts
Created October 13, 2020 13:13
TypeScript - convert enum to array
/**
* https://dirask.com/posts/TypeScript-convert-enum-to-array-ZDN4nj
*/
class EnumReflection {
private static REGEXP : RegExp = /^[0-9]+$/g;
private static isString<T>(name : string) : boolean {
if(name.match(this.REGEXP))
return false;