Skip to content

Instantly share code, notes, and snippets.

View agrublev's full-sized avatar
💭
Always moving forward

Angel Grablev agrublev

💭
Always moving forward
View GitHub Profile
@agrublev
agrublev / bootstrap.sh
Last active November 10, 2022 07:15 — forked from hemenkapadia/bootstrap.sh
[Ubuntu Bootstrap]
#!/bin/bash
# Check sudo.
# If credentials not already cached, ask for password and cache credentials.
# If already cached, increase sudo timeout by 5 min
sudo -v && exit 1 'Sudo access needed to execute this script'
# First update
echo "Updating apt list ...."
@agrublev
agrublev / unquoted_json_fix.js
Last active April 5, 2022 09:38 — forked from larruda/unquoted_json_fix.js
REGEX to add quotes to JSON unquoted keys (turns an invalid JSON into a valid one). fix json string
const fixJsonStr=str=>str.replace(/(\s*?{\s*?|\s*?,\s*?)(['"])?([a-zA-Z0-9_]+)(['"])?:/g, '$1"$3":');
let zzzz=fixJsonStr(`{
"kettty": "",
asds: [], kggk:{},
"ga": 222,
"sad": {
"zz": 0,
"as": false,
"gag": []
@agrublev
agrublev / better-font-smoothing.css
Created May 27, 2020 11:02 — forked from hsleonis/better-font-smoothing.css
Better font smoothing in cross browser
html {
/* Adjust font size */
font-size: 100%;
-webkit-text-size-adjust: 100%;
/* Font varient */
font-variant-ligatures: none;
-webkit-font-variant-ligatures: none;
/* Smoothing */
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
@agrublev
agrublev / index.js
Created January 25, 2019 00:06 — forked from zkat/index.js
npx is cool
#!/usr/bin/env node
console.log('yay gist')
@agrublev
agrublev / parse_dotenv.bash
Created December 20, 2018 05:16 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@agrublev
agrublev / dronefly.js
Last active June 24, 2018 23:12 — forked from bearoff/dronefly.js
drone FORK!
const pdrone = require('pdrone');
const drone = pdrone({id: 'mambo', debug: false});
/** Helper function */
function sleep(ms) {
return new Promise(a => setTimeout(a, ms));
}
// DIRECTIONS
// - up / down / left / right /forward /back
@agrublev
agrublev / lirc-pi3.txt
Created March 15, 2018 15:41 — forked from prasanthj/lirc-pi3.txt
Getting lirc to work with Raspberry Pi 3 (Raspbian Stretch)
Notes to make IR shield (made by LinkSprite) work in Raspberry Pi 3 (bought from Amazon [1]).
The vendor has some documentation [2] but that is not complete and sufficient for Raspbian Stretch.
Following are the changes that I made to make it work.
$ sudo apt-get update
$ sudo apt-get install lirc
# Add the following lines to /etc/modules file
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17
@agrublev
agrublev / app.js
Created September 14, 2017 04:18 — forked from ColCh/app.js
catch errors and send 'em to Crashlytics in React Native
// WARNING: SIDE-EFFECTS. ONLY FOR PROD VERSION
if (!__DEV__) {
require('./utils/log.js');
}
// SIDE-EFFECTS END
@agrublev
agrublev / .bash_profile
Last active April 19, 2017 14:46 — forked from natelandau/.bash_profile
Mac OSX Bash Profile Linux
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management