Skip to content

Instantly share code, notes, and snippets.

View JuanCaicedo's full-sized avatar
🥑

Juan Caicedo JuanCaicedo

🥑
View GitHub Profile
@JuanCaicedo
JuanCaicedo / console-log.el
Last active January 22, 2018 07:40
Add a spacemacs/emacs keybinding for console.log insertion
;; if using spacemacs, place this code inside dotspacemacs/user-config
;; otherwise, just put it in .emacs
(defun insert-console-log ()
"Insert console.log of the variable at point."
(interactive)
(let ((beg nil)
(end nil))
(back-to-indentation)
(setq beg (point))
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
local nvm_node=''
nvm_node='%{$fg[green]%}‹node-$(nvm_prompt_info)›%{$reset_color%}'
local git_branch='$(git_prompt_info)%{$reset_color%}'
PROMPT='$(nvm_prompt_info) $(git_prompt_info)
%{$fg[cyan]%}%c ${ret_status}%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg[red]%}"
#!/usr/bin/env coffee
process.setMaxListeners(0)
penthouse = require('penthouse')
path = require('path')
fs = require('fs')
_ = require('lodash')
async = require('async')
os = require('os')
;; -*- mode: emacs-lisp -*-
;; This File is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory

Keybase proof

I hereby claim:

  • I am juancaicedo on github.
  • I am juancaicedo (https://keybase.io/juancaicedo) on keybase.
  • I have a public key ASDExytt9hYizi26VsDxHDRFAhuOwFuxY8cuN15ajgVZNAo

To claim this, I am signing this object:

#! /usr/bin/env bash
osascript <<EOF
display notification "$1" with title "$2"
EOF
@JuanCaicedo
JuanCaicedo / e2e-testing-research.md
Last active September 5, 2016 17:05
A summary of some e2e tools I researched

e2e testing with node

Recommendation: CasperJs

I prototyped a few different approaches to e2e tests and in the end my recommendation is to use casperjs.

Pros

  • It seems to have the simplest API.
@JuanCaicedo
JuanCaicedo / make-it-modular-solution.js
Last active May 30, 2016 15:54
This is an example solution to exercise 6 in learnyounode, "Make it Modular"
/* main.js */
var myModule = require('./my-module');
var directory = process.argv[2];
var filter = process.argv[3];
var callback = function(error, filtered) {
if (error) {
console.log('error');
console.log(error);

Elm to Javascript

Introduction

Elm is a fantastic programming language. It faciliates a style of structuring web applications, both through functional programming and the Elm architecture, that allows for code that is modular, reliable, and easy to refactor.

If you are starting a new project that requires a fast interactive front-end and you are willing or able to learn a new language and ecosystem, I would strongly