Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Avaray's full-sized avatar
🙂
Looking for work

Avaray Avaray

🙂
Looking for work
View GitHub Profile
@Avaray
Avaray / app.js
Last active February 24, 2019 14:15
[NodeJS] Puppeteer Starter // for API visit https://pptr.dev/
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({headless: true})
var pages = await browser.pages()
var page = pages[0]
await page.goto('')
@Avaray
Avaray / rpi_update
Last active June 10, 2021 07:46
[BASH] Script for updating Raspberri Pi 3b+
#!/bin/bash
dir="$(dirname "$(realpath "$0")")"
log="$(
date
sudo apt-get -y update
sudo apt-get -y upgrade
sudo rpi-update
sudo apt-get autoremove
@Avaray
Avaray / app.js
Created January 10, 2019 22:33
[NodeJS] Create HTTP server in simple way
require('http')
.createServer()
.listen({
port: 4000
})
.on('request', (req, res) => {
res.end('Hello World!');
});
@Avaray
Avaray / app.js
Created May 11, 2018 00:18
[JS] Sort Keys in Object alphabetically
let a = {};
Object.keys(b).sort().forEach(key => {
a[key] = b[key];
});
@Avaray
Avaray / app.js
Last active May 11, 2018 00:18
[JS] Delete empty Keys from Object
function clean(o) {
Object.keys(o).forEach(k => (!o[k] && o[k] !== undefined) && delete o[k]);
return o;
}
@Avaray
Avaray / style.pug
Created November 2, 2017 01:56
Pug // Condition in CSS in .pug partial file // https://stackoverflow.com/a/41618071/4415165
style
.
.someclass1{
font-size:10px;
}
.someclass2{
font-size:10px;
}
if options.key1=='a'
.
@Avaray
Avaray / app.js
Last active November 1, 2017 15:37
Node JS // Get list of all directories (not recursive)
var fs = require('fs')
var path = require('path')
var location = 'content'
fs.readdirSync(location)
.filter(x => {
return fs.lstatSync(path.join(location, x)).isDirectory()
})
.forEach(dir => {
@Avaray
Avaray / gist:8a6b8e2cf872edf49a1d5e2317d0ddde
Last active February 7, 2019 21:13
List of blogs with rating 100/100 in Google PageSpeed Insights.
// REAL BLOGS, ENTIRELY OPTIMISED
https://blog.fefe.de/
http://prog21.dadgum.com/
https://zupzup.org/
https://elliotec.com
https://www.tedunangst.com/flak/
http://rtfm.killfile.pl/
// OTHER BLOGS OR MOTIVATIONS YOU CAN CHECK
@Avaray
Avaray / mouse_block_sidebuttons.ahk
Last active November 22, 2016 12:02
AutoHotKey (AHK) script for blocking/removing default actions (backward and forward) from Mouse side buttons. You can hold this file anywhere, even on your removable device. All you need to do is add Shortcut to Windows startup folder. Of course You need to have AHK installed (download it from https://autohotkey.com).
XButton1::Return
XButton2::Return
@Avaray
Avaray / entities.txt
Last active December 26, 2016 07:22
List of Team Fortress 2 Entities (2016-11-22)
_ballplayertoucher
_firesmoke
_plasma
ai_ally_speech_manager
ai_battle_line
ai_changehintgroup
ai_changetarget
ai_goal_assault
ai_goal_follow
ai_goal_lead