Skip to content

Instantly share code, notes, and snippets.

@jptcnde
jptcnde / touchpad-xorg
Created July 17, 2019 18:55
configure linux ubuntu touchpad
Section "InputClass"
Identifier "06CB0001:00 06CB:7FB4 Touchpad" # check the device name with xinput list
MatchIsTouchPad "on"
MatchDevicePath "/dev/input/event*"
MatchDriver "libinput"
Option "AccelSpeed" "0.9"
Option "NaturalScrolling" "true"
Option "ScrollMethod" "twofinger"
Option "SendEventsMode" "enabled"
Option "Tapping" "1"
function triggerEvent(el, eventName) {
var event;
if (document.createEvent) {
event = document.createEvent('HTMLEvents');
event.initEvent(eventName, true, true);
} else if (document.createEventObject) { // IE < 9
event = document.createEventObject();
event.eventType = eventName;
}
event.eventName = eventName;
@jptcnde
jptcnde / install-docker-ce-on-elementaryos-loki.sh
Created September 23, 2018 05:59 — forked from BeerOnBeard/install-docker-ce-on-elementaryos-loki.sh
Install Docker CE on ElementaryOS 0.4.1 Loki
#!/bin/bash
set -e
##########################################################
# Install script for Docker-CE on ElementaryOS 0.4.1 Loki
# Had to update the repository to point to xenial instead
# of using 'lsb_release -cs' because there's no loki
# repository at download.docker.com.
##########################################################
@jptcnde
jptcnde / bash-cheatsheet.sh
Created September 16, 2018 06:06 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
#!/bin/bash
# Update resources
sudo apt update && sudo apt upgrade -y
sudo apt install dpkg
sudo apt install -y software-properties-common software-properties-gtk dconf-editor
sudo apt install synaptic -y
@jptcnde
jptcnde / install_font_adobe_source_code_pro.sh
Created September 8, 2018 09:15 — forked from enzinier/install_font_adobe_source_code_pro.sh
Install font Adobe Source Code Pro on Ubuntu 16.04 LTS
#!/bin/sh
# Userland mode (~$USER/), (~/).
# ~/.fonts is now deprecated and that
#FONT_HOME=~/.fonts
# ~/.local/share/fonts should be used instead
FONT_HOME=~/.local/share/fonts
echo "installing fonts at $PWD to $FONT_HOME"
mkdir -p "$FONT_HOME/adobe-fonts/source-code-pro"
@jptcnde
jptcnde / crockford.js
Created August 23, 2018 06:47
crockford-exercises - functional programming
/*
* This is a JavaScript Scratchpad.
*
* Enter some JavaScript, then Right Click or choose from the Execute Menu:
* 1. Run to evaluate the selected text (Ctrl+R),
* 2. Inspect to bring up an Object Inspector on the result (Ctrl+I), or,
* 3. Display to insert the result in a comment after the selection. (Ctrl+L)
*/
function identityf(x) {
@jptcnde
jptcnde / HOC.js
Created April 24, 2018 13:21 — forked from Restuta/HOC.js
React HOC (Higher Order Component) Example
/* HOC fundamentally is just a function that accepts a Component and returns a Component:
(component) => {return componentOnSteroids; } or just component => componentOnSteroids;
Let's assume we want to wrap our components in another component that is used for debugging purposes,
it just wraps them in a DIV with "debug class on it".
Below ComponentToDebug is a React component.
*/
//HOC using Class
//it's a function that accepts ComponentToDebug and implicitly returns a Class
let DebugComponent = ComponentToDebug => class extends Component {
@jptcnde
jptcnde / traverseObjByPath.js
Last active April 20, 2018 09:58
Traverse object by Array as path, returns the value when search term exists
/* desc:
- get and traverse the value from an Object
- returns immediately if found value is an Array data type
params
node: Object
path: Array
usage:
var obj = {
name: 'john doe',
@jptcnde
jptcnde / cloudSettings
Last active December 19, 2021 17:32
Visual Studio Code Settings Sync Gist - new
{"lastUpload":"2021-12-19T17:32:53.959Z","extensionVersion":"v3.4.3"}