Skip to content

Instantly share code, notes, and snippets.

@jptcnde
jptcnde / .zprestorc.sh
Last active March 30, 2018 09:05
.zshrc - zsh conf with prezto
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <[email protected]>
#
#
# General
#
@jptcnde
jptcnde / st3_sync
Created March 31, 2018 12:11 — forked from mindmergedesign/st3_sync
Sync Sublime Text 3 Packages and Settings with Dropbox
####################
# FROM MAIN COMPUTER
####################
# Create the sync directory in Dropbox
$ mkdir ~/Dropbox/sublime-text-3
# Move your ST3 "Packages" and "Installed Packages" to Dropbox
$ cd ~/Library/Application\ Support/Sublime\ Text\ 3
$ mv Packages/ ~/Dropbox/sublime-text-3
$ mv Installed\ Packages/ ~/Dropbox/sublime-text-3
@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"}
@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 / 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 / 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 / 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"
#!/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 / 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
@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.
##########################################################