Skip to content

Instantly share code, notes, and snippets.

View avesus's full-sized avatar
🎯
Focusing

Brian Cannard avesus

🎯
Focusing
View GitHub Profile
@avesus
avesus / typescript-babel-cmdlines.md
Created July 7, 2016 07:25
TypeScript and Babel command lines
tsc --watch --isolatedModules --pretty --skipDefaultLibCheck --listFiles --target es5 --moduleResolution node --module commonjs --inlineSourceMap --inlineSources --noResolve --jsx react --removeComments --strictNullChecks --project . --outDir . --rootDir src
babel --watch --source-maps inline --ignore "*.d.ts" --extensions ".js",".jsx" src --out-dir . --minified --compact --no-comments
@avesus
avesus / convert.sh
Created August 23, 2016 17:25
Convert png to pdf
sudo apt-get install imagemagick
# To rename files with spaces:
find -name "* *" -type f | rename 's/ /_/g'
ls page*.png | sort -n | tr '\n' ' ' | sed 's/$/\ mydoc.pdf/' | xargs convert
@avesus
avesus / gist:e17a261cc27cf227e7c08045e798565a
Created May 15, 2017 21:24
Job Aggregators Worldwide
<option value="Adzuna">Adzuna</option>
<option value="AfterCollege">AfterCollege</option>
<option value="Big4adicio">Big4adicio</option>
<option value="CareerBuilder">CareerBuilder</option>
<option value="CareerJet">CareerJet</option>
<option value="CollegeRecruiter">CollegeRecruiter</option>
<option value="CommunicationsJobs.net">CommunicationsJobs</option>
<option value="Coroflot">Coroflot</option>
<option value="CraigsList">Craigslist</option>
<option value="CustomerServiceJobs.com">CustomerServiceJobs</option>
@avesus
avesus / UI Experience
Created May 17, 2017 16:29
UI Experience
Graphic Design / UI/UX design works:
2017 Mobile App Design
2015 Dashboard Design
2012 Radmin Installer Wizard Design
Desktop Application Installer Wizard Design
Desktop Application Design
2011 Complex Installer Wizard Design for 3 Types of Remote Control Infrastructure Servers
2010 Installer Wizard Design
2009 Testing Console Design
@avesus
avesus / etc_init.d_mynodeserver
Created July 29, 2017 16:12
Saving RAM on tough servers using daemontools instead of forever.js
#! /bin/sh
# /etc/init.d/mynodeserver
case "$1" in
start)
supervise /var/www/mynodeserver >> /var/log/mynodeserver.com.nodejs.log 2>/var/log/mynodeserver.com.error.log &
;;
stop)
svc -d /var/www/mynodeserver
svc -x /var/www/mynodeserver
@avesus
avesus / .bashrc
Last active June 19, 2022 04:09
Vim with NERDTree Adequate Defaults
# I love super fast keyboard. Most of my friends and colleagues can't follow
# I use `atkbd.softrepeat=1` on the kernel command line.
# Even Visual Assist plugin in Visual Studio doubles keyboard repeat rate with _a reason_.
# I'm working on my laptop without X installed to avoid procrastination.
# I've spend a working day googling how to make `kbdrate` using slower delay than 250.
# Add this to your /etc/profile.d/kbdrate.sh: sudo kbdrate -r 82 -d 150 if you want it in console.
# Note that it will force you type password twice. I didn't find any workarounds.
xset r rate 150 82
# When exiting from Vim, just type
@avesus
avesus / ios-fixed-keyboard.html
Created September 4, 2017 19:13
iOS keep fixed as fixed on input focus when virtual keyboard shows up and WebKit insanely scrolls the whole window
<!DOCTYPE html>
<html style="height: 100%">
<head>
<meta name="viewport" content="initial-scale=1, minimum-scale=1, maximum-scale=1" />
<style>
#fixedsContainer {
position: absolute;
top: 0px;
bottom: 0px;
width: 320px;
@avesus
avesus / September 2017 iOS WebKit input focus position: fixed.md
Created September 4, 2017 23:24
September 2017 iOS WebKit input focus position: fixed

Mobile Safari does not support position: fixed when an input focused and virtual keyboard displayed.

To force it work the same way as Mobile Chrome, you have to use position: absolute, height: 100% for the whole page or a container for your pseudo-fixed elements, intercept scroll, touchend, focus, and blur events.

The trick is to put the tapped input control to the bottom of screen before it activates focus. In that case iOS Safari always scrolls viewport predictably and window.innerHeight becomes exactly visible height.

Open https://avesus.github.io/docs/ios-keep-fixed-on-input-focus.html in Mobile Safari to see how it works.

Please avoid forms where you have several focusable elements because more tricks to fix position will be necessary, those were added just for demonstration purposes.

@avesus
avesus / nginx.conf
Last active December 1, 2017 05:55
Nginx perfect nodern SPA config
location /app/ {
expires max;
}
location /img/ {
expires max;
}
location = /favicon.ico {
try_files $uri =204;