Skip to content

Instantly share code, notes, and snippets.

View acamino's full-sized avatar
💭
千本桜景厳

Agustin Camino acamino

💭
千本桜景厳
  • Genome, LLC
  • Quito, Ecuador
View GitHub Profile
@acamino
acamino / Prelude.hs
Last active December 29, 2015 11:14
CIS 194 Week 4
-- Prelude functions which are defined in terms of foldr
-- http://www.cis.upenn.edu/~cis194/spring13/lectures/04-higher-order.html
length' :: [a] -> Int
length' = foldr (\_ acc -> 1 + acc) 0
sum' :: Num a => [a] -> a
sum' = foldr (*) 1
product' :: Num a => [a] -> a
@acamino
acamino / release_them.rb
Created February 3, 2016 01:40
Releasing Twilio Numbers
# The numbers will be pulled in groups of 50, so if you
# have more than 50 numbers then you'll have to run this
# script more than once.
require 'twilio-ruby'
# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
client = Twilio::REST::Client.new(account_sid, auth_token)
@acamino
acamino / working-with-forks.md
Last active February 29, 2016 21:59
Working with forks

Working with Forks

List remotes repositories.

git remote -v

Add a new remote upstream repository that will be synced with the fork.

@acamino
acamino / CallController.Create.cs
Created August 25, 2016 17:13
Blog: Build a Simple Phone Verification System with Twilio Voice, C#, SQL Server, and jQuery
// POST: Call/Create
[HttpPost]
public async Task<JsonResult> Create(string phoneNumber)
{
// Delete a phone number.
await _service.DeleteByPhoneNumberAsync(phoneNumber);
// Create a phone number.
var verificationCode = GenerateVerificationCode();
await _service.CreateAsync(
@acamino
acamino / colors.sh
Created October 20, 2016 11:18
Bash Colors
#!/bin/bash
echo -e "\033[0mCOLOR_NC (NO COLOR)"
echo -e "\033[1;37mCOLOR_WHITE\t\033[0;30mCOLOR_BLACK"
echo -e "\033[0;34mCOLOR_BLUE\t\033[1;34mCOLOR_LIGHT_BLUE"
echo -e "\033[0;32mCOLOR_GREEN\t\033[1;32mCOLOR_LIGHT_GREEN"
echo -e "\033[0;36mCOLOR_CYAN\t\033[1;36mCOLOR_LIGHT_CYAN"
echo -e "\033[0;31mCOLOR_RED\t\033[1;31mCOLOR_LIGHT_RED"
echo -e "\033[0;35mCOLOR_PURPLE\t\033[1;35mCOLOR_LIGHT_PURPLE"
echo -e "\033[0;33mCOLOR_YELLOW\t\033[1;33mCOLOR_LIGHT_YELLOW"
@acamino
acamino / .vimrc
Last active October 24, 2016 11:20
Vim Custom Configuration
" Quickly toggle between relative and no relative line numbers
function! NumberToggle()
if(&relativenumber == 1)
set norelativenumber
else
set relativenumber
endif
endfunc
nnoremap <C-L> :call NumberToggle()<CR>
@acamino
acamino / authoring_with_viewsaurus.md
Last active November 8, 2016 19:33
Authoring with viewsaurus

Authoring Tutorials with Viewsaurus

Recently I've been writing a few tutorials for Twilio, so far it was a pleasant experience. It's always fun to play with a nice API in the languages you like, right?

The tool we're using to write these tutorials made our work easy. I enjoyed working with viewsaurus.

If you have to use this viewsaurus,

@acamino
acamino / Todo.hs
Last active January 20, 2017 12:33
TODO manager in Haskell
import System.Directory
import System.Environment
import System.IO
import Control.Monad
import Data.List
dispatch :: [(String, [String] -> IO ())]
dispatch = [ ("add", add)
, ("view", view)
, ("remove", remove)
@acamino
acamino / IncomingController.cs
Last active October 5, 2017 15:10
Secure your C# / ASP.NET WEB API by validating incoming Twilio Requests
using System.Net.Http;
using System.Text;
using System.Web.Http;
using Twilio.TwiML;
using ValidateRequestExample.Filters;
namespace ValidateRequestExample.Controllers
{
public class TwilioMessagingRequest
{
@acamino
acamino / IncomingController.cs
Created October 10, 2017 21:51
Secure your C# / ASP.NET Core by validating incoming Twilio Requests
using Microsoft.AspNetCore.Mvc;
using Twilio.TwiML;
using ValidateRequestExample.Filters;
namespace ValidateRequestExample.Controllers
{
public class IncomingController : Controller
{
[ValidateTwilioRequest]
[Produces("text/xml")]