Skip to content

Instantly share code, notes, and snippets.

View lporras's full-sized avatar
🏠
Working from home

Luis Alfredo Porras Páez lporras

🏠
Working from home
View GitHub Profile

some tricky test moments in Jasmine

If you know RSpec, Jasmine is easy! But some common uses of JavaScript may not be as immediately obvious.

Try to use Jasmine (you could use your own setup or just tryjasmine.com) to write some specs that cover cases like these. The links will load up an example.

@lporras
lporras / README.md
Last active January 2, 2016 21:34 — forked from jimothyGator/README.md
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default and default-ssl to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew install rbenv ruby-build
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
rbenv install 2.2.2
rbenv global 2.2.2
@lporras
lporras / backbone-validation-bootstrap.js.coffee
Created September 27, 2015 23:50 — forked from driehle/backbone-validation-bootstrap.js.coffee
Render error messages of Backbone.Validation for Twitter Bootstrap
# --------------------------------------------
# This code is for Twitter Bootstrap 2!
# --------------------------------------------
#
# The MIT License (MIT)
# Copyright (c) 2012-2015 Dennis Riehle
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@lporras
lporras / .vimrc
Created October 22, 2015 21:02 — forked from gosukiwi/.vimrc
.vimrc
" ---------------------- USABILITY CONFIGURATION ----------------------
" Basic and pretty much needed settings to provide a solid base for
" source code editting
" don't make vim compatible with vi
set nocompatible
" turn on syntax highlighting
syntax on
" and show line numbers
@lporras
lporras / git bash prompt
Created June 1, 2016 01:24 — forked from hintjens/git bash prompt
git bash prompt, by Pieter Hintjens
export PROMPT_COMMAND=__git_prompt
__git_prompt ()
{
txtblk='\e[0;30m' # Black - Regular
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
txtblu='\e[0;34m' # Blue
txtpur='\e[0;35m' # Purple
txtcyn='\e[0;36m' # Cyan
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@lporras
lporras / pokemons.js
Created August 25, 2016 18:45 — forked from coldcue/pokemons.js
Pokemons
[{id:1,name:'Bulbasaur'},
{id:2,name:'Ivysaur'},
{id:3,name:'Venusaur'},
{id:4,name:'Charmander'},
{id:5,name:'Charmeleon'},
{id:6,name:'Charizard'},
{id:7,name:'Squirtle'},
{id:8,name:'Wartortle'},
{id:9,name:'Blastoise'},
{id:10,name:'Caterpie'},
@lporras
lporras / ocr.rb
Created October 3, 2016 14:54 — forked from jyunderwood/ocr.rb
require 'base64'
require 'open-uri'
require 'net/http'
require 'net/https'
require 'json'
class OCR
attr_reader :api_key, :image_url
def self.scan(api_key:, image_url:)
@lporras
lporras / ruby_ftp_example.rb
Created November 16, 2017 21:42 — forked from 3dd13/ruby_ftp_example.rb
Sample code of using Ruby Net::FTP library. Login to FTP server, list out files, check directory existence, upload files
require 'net/ftp'
CONTENT_SERVER_DOMAIN_NAME = "one-of-the-ftp-server.thought-sauce.com.hk"
CONTENT_SERVER_FTP_LOGIN = "saucy-ftp-server-login"
CONTENT_SERVER_FTP_PASSWORD = "saucy-ftp-server-password"
# LOGIN and LIST available files at default home directory
Net::FTP.open(CONTENT_SERVER_DOMAIN_NAME, CONTENT_SERVER_FTP_LOGIN, CONTENT_SERVER_FTP_PASSWORD) do |ftp|
files = ftp.list