Skip to content

Instantly share code, notes, and snippets.

View rchacon's full-sized avatar
🥑

Raul Chacon rchacon

🥑
  • Syracuse, New York
View GitHub Profile
@rchacon
rchacon / ubuntu16.04-command-line-install-android-sdk
Created January 27, 2018 04:07 — forked from guipmourao/ubuntu16.04-command-line-install-android-sdk
Ubuntu 16.04 command line install android sdk
# create sdk folder
export ANDROID_HOME=/opt/android-sdk-linux
sudo mkdir -p $ANDROID_HOME
# install openjdk
sudo apt-get install openjdk-8-jdk
# download android sdk
cd $ANDROID_HOME
sudo wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
@rchacon
rchacon / timed_passes.py
Created November 23, 2016 05:26
Script to send text about status of time passes to NMAAHC for April to June 2017
"""
$ pip install pygooglevoice==0.5.2 requests
$ python timed_passes.py
"""
from googlevoice import Voice
import requests
URL = 'https://nmaahc.si.edu/visit/passes'
TEXT = 'We will announce soon when Advanced Timed Passes for April through June 2017 will be available.'
"""
Scrape shows from http://www.thechapelsf.com/music/
Usage:
$ python chapelsf.py
Sample output:
[ { 'artist': 'Emily King',
'show_date': 'Wed 8/03 Doors: 8:00 pm / Show: 9:00 pm',
@rchacon
rchacon / mupen64plus.cfg
Last active May 13, 2017 03:31
Xbox 360 Controller bindings for Mupen64 on OSX
[Input-SDL-Control1]
# Mupen64Plus SDL Input Plugin config parameter version number. Please don't change this version number.
version = 2
# Controller configuration mode: 0=Fully Manual, 1=Auto with named SDL Device, 2=Fully automatic
mode = 0
# Specifies which joystick is bound to this controller: -1=No joystick, 0 or more= SDL Joystick number
device = 0
# SDL joystick name (or Keyboard)
name = "Xbox 360 Wired Controller"
@rchacon
rchacon / editorconfig
Last active February 13, 2016 05:12
Create .editorconfig in current directory. Add sym link to script: `ln -s <path to editorconfig script> /usr/local/bin/editorconfig`
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
@rchacon
rchacon / test_xmas.py
Last active February 9, 2016 23:50
Dependency Injection and Partial Mocking
class XmasTest(unittest.TestCase):
@mock.patch('xmas.date')
def test_days_til_xmas_when_xmas(self, mock_date):
mock_date.today.return_value = date(2020, 12, 25)
mock_date.side_effect = lambda *args, **kw: date(*args, **kw)
days = days_til_xmas()
self.assertEqual(days, 0)
@rchacon
rchacon / README.md
Last active August 29, 2015 14:17
Resharper Code Snippets

my resharper snippets

@rchacon
rchacon / UsersRepository.cs
Created March 13, 2015 03:19
Validate and Search against Active Directory
namespace api_v1_csharp.Models.ldap
{
using System;
using System.DirectoryServices;
using System.DirectoryServices.ActiveDirectory;
using System.DirectoryServices.AccountManagement;
using System.Collections.Generic;
public class UsersRepository : IUsersRepository
{
@rchacon
rchacon / .htaccess
Created January 12, 2015 03:00
Python on 1and1
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /mysite/application.cgi/$1 [L]
@rchacon
rchacon / compress.py
Created December 20, 2014 04:14
Count occurrences of letters in string.
"""
hhhhh aaaaa => h5 5a5
"""
def compress_sentence(sentence):
prev_letter = sentence[0]
frequency = 1
output = ''
for letter in sentence[1:]: