Skip to content

Instantly share code, notes, and snippets.

:octocat:
Coding

Miguel Mota miguelmota

:octocat:
Coding
Block or report user

Report or block miguelmota

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@miguelmota
miguelmota / bin.js
Last active Oct 13, 2019
Node.js CLI read pipe data input example
View bin.js
if (process.stdin) {
process.stdin.setEncoding('utf8')
process.stdin.resume()
let content = ''
process.stdin.on('data', (buf) => {
content += buf.toString()
})
setTimeout(() => {
const value = content.trim()
@miguelmota
miguelmota / eventemitter.js
Created Oct 10, 2019
Node.js EventEmitter example
View eventemitter.js
const EventEmitter = require('events').EventEmitter
const myEmitter = new EventEmitter()
myEmitter
.on('foo', (result) => {
// after 1 second
console.log(result) // { message: 'hello world' }
})
.on('bar', (result) => {
@miguelmota
miguelmota / notify.sh
Created Sep 30, 2019
Linux i3 send notification alert example
View notify.sh
notify-send -t 1000 'hello world'
@miguelmota
miguelmota / config
Last active Sep 30, 2019
Linux i3 brightness controls
View config
# Screen brightness controls (requires https://github.com/haikarainen/light)
bindsym XF86MonBrightnessUp exec light -A 10 # increase screen brightness
bindsym XF86MonBrightnessDown exec light -U 10 # decrease screen brightness
@miguelmota
miguelmota / config
Created Sep 30, 2019
Linux i3 audio controls
View config
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl -- set-sink-volume 0 +5% #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl -- set-sink-volume 0 -5% #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound
@miguelmota
miguelmota / config
Created Sep 28, 2019
Linux Ubuntu i3 run dropbox
View config
exec --no-startup-id dropbox start
@miguelmota
miguelmota / install_i3_gaps.sh
Created Sep 26, 2019
Linux (Ubuntu) install i3-gaps
View install_i3_gaps.sh
sudo apt remove i3* && sudo apt autoremove
sudo add-apt-repository ppa:kgilmer/speed-ricer
sudo apt-get update
sudo apt-get install i3-gaps
sudo shutdown -r now
@miguelmota
miguelmota / .Xresources
Last active Sep 26, 2019
Linux rofi menu customize theme colors
View .Xresources
rofi.color-window: #000000, #000000, #999999
rofi.color-normal: #000000, #ffffff, #000000, #999999, #ffffff
rofi.color-active: #000000, #ffffff, #000000, #999999, #ffffff
rofi.color-urgent: #000000, #ffffff, #000000, #999999, #ffffff
@miguelmota
miguelmota / install.sh
Created Sep 25, 2019
Linux i3 change desktop background image
View install.sh
sudo apt-get install feh
feh --bg-scale ~/Pictures/background.jpg
View i3_cheatsheet.txt
Basics
mod + enter open new terminal
mod + j focus left
mod + k focus down
mod + l focus up
mod + ; focus right
mod + a focus parent
mod + space toggle focus mode
Moving windows
You can’t perform that action at this time.