Skip to content

Instantly share code, notes, and snippets.

View fcpauldiaz's full-sized avatar
🔪
Slaying Bugs

Pablo Díaz fcpauldiaz

🔪
Slaying Bugs
View GitHub Profile
function flatten (array) {
// check that input is an array
if (array.constructor === Array) {
return array.reduce((accum, currentValue) => {
if (array.constructor === Array) {
// flatten the array using es6 reducer
return accum.concat(currentValue.reduce(flatten, []))
} else {
// append/concat
return accum.concat(currentValue)
@fcpauldiaz
fcpauldiaz / gist:fb7418a986c1caf8b6a1359e44730ede
Created March 14, 2018 14:44
Visual Code Installed TEC Extensions
1. Cobalt 2 Theme Official
2. Color Info
3. CSS Peek
4. DotENV
5. ESLint
6. Material Icon Theme
7. Material Theme
8. Node.js Module intellisense
9. Prettier
10. Sort Lines
@fcpauldiaz
fcpauldiaz / user settings
Last active March 14, 2018 15:09
Visual Code TEC settings
{
"workbench.colorTheme": "Sublime Material Theme - Dark",
"terminal.integrated.fontFamily": "'Terminess Powerline', 'Anonymice Powerline', 'Roboto Mono for Powerline', 'Meslo LG S for Powerline', 'DejaVu Sans Mono', 'Lucida Console'",
"sublimeTextKeymap.promptV3Features": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.snippetSuggestions": "top",
"editor.formatOnPaste": true,
"window.zoomLevel": 1,
"workbench.iconTheme": "material-icon-theme",
"team.showWelcomeMessage": false,
altgraph==0.10.2
appdirs==1.4.3
attrs==17.4.0
backports.shutil-get-terminal-size==1.0.0
backports.ssl-match-hostname==3.5.0.1
bdist-mpkg==0.5.0
bleach==1.5.0
bonjour-py==0.3
cmake==0.6.0
configparser==3.5.0
activemq erlang@19 jpeg nmap r
android-sdk fontconfig kubernetes-cli node rabbitmq
aspcud freetype leptonica ocaml readline
augeas gcc libev ocamlbuild redis
autoconf gcc@4.8 libevent ocrad sqlite
aws-elasticbeanstalk gd libmpc opam ssh-copy-id
boost gdbm libmpc@0.8 openssl tee-clc
c-ares gettext libpng openssl@1.1 tesseract
camlp4 git-flow libtiff pcre thefuck
certbot gmp libtool php-cs-fixer unixodbc
├── @angular/cli@1.6.8
├── artillery@1.6.0-9
├── bower@1.8.0
├── chapimoneda@0.0.2 -> /Users/SDX/Documents/react/chapimoneda
├── cordova@6.5.0
├── create-react-app@1.4.0
├── create-react-native-app@1.0.0
├── depcheck@0.6.7
├── electron-packager@10.1.1
├── electron-prebuilt@1.4.10
@fcpauldiaz
fcpauldiaz / Visual Code Key Bindings
Last active April 5, 2017 20:16
Visual Code Key Bindings for Mac - Sublime Text
// Place your key bindings in this file to overwrite the defaults
[{
"key": "cmd+]",
"command": "workbench.action.zoomIn",
"when": "editorTextFocus"
}
,{
"key": "cmd+/",
"command": "workbench.action.zoomOut",
"when": "editorTextFocus"
@fcpauldiaz
fcpauldiaz / Sublime User Preferences.json
Created October 3, 2016 00:07
Sublime User Preferences
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
"font_size": 15,
"ignored_packages":
[
"Vintage"
],
"indent_guide_options":
@fcpauldiaz
fcpauldiaz / User Keybindings
Last active October 3, 2016 06:27
Sublime Key Bindings
[
// Origami plugin customization
{ "keys": ["alt+right"], "command": "travel_to_pane", "args": {"direction": "right"} },
{ "keys": ["alt+left"], "command": "travel_to_pane", "args": {"direction": "left"} },
{ "keys": ["ctrl+shift+k"], "command": "refresh_folder_list" },
{ "keys": ["command+7"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["command+shift+7"], "command": "toggle_comment", "args": { "block": true } },
{
"keys": ["tab"], "command": "expand_abbreviation_by_tab", "context": [
@fcpauldiaz
fcpauldiaz / Write-Read
Created September 28, 2016 02:40
Writter/Read Nachos pseudo code
ConditionVariable OkToRead
ConditionVariable OkToWrite
Read () {
//check if there are writers active or waiting
Lock acquire()
while (WW + AW > 0) {
WR++ //contamos como un lector
OkToRead.wait() //sleep()
WR--