Skip to content

Instantly share code, notes, and snippets.

View tcarrio's full-sized avatar
🧙‍♂️

Tom Carrio tcarrio

🧙‍♂️
View GitHub Profile
@tcarrio
tcarrio / gpio_python2.py
Last active March 2, 2017 02:33 — forked from anonymous/gist:fdf5c09391dee8ba5102f64a81bb8bbf
Displays current range sensors detected distance and turns LED on/off based on that distance compared to user input
from gpiozero import DistanceSensor
from gpiozero import LED
requirement = int(raw_input('Input required distance in [cm]: '))
led = LED(5)
sensor = DistanceSensor(echo=18, trigger=17)
while True:
distanceRead = sensor.distance * 100
print('Distance: ', distanceRead)
if distanceRead >= requirement:
@tcarrio
tcarrio / FBCTF-ARM.md
Last active May 14, 2016 17:16 — forked from anonymous/README.md
fbctf-arm-notes

This is a collection of information on Facebooks CTF release on Github.

The idea is to create an ARM compatible release of the project that should be useable on Raspberry Pi systems.

The Github Page

Facebook CTF is available at /facebook/fbctf.

Observations on the Software Stack

@tcarrio
tcarrio / gogs.init
Created April 16, 2016 04:42 — forked from lbeltrame/gogs.init
CentOS Gogs init script
#!/bin/bash
#
# /etc/rc.d/init.d/gogs
#
# Runs the Gogs Go Git Service.
#
#
# chkconfig: - 85 15
#
@tcarrio
tcarrio / get_os-release.py
Last active February 9, 2016 17:28
distro-agnostic-get_os-release
filenames = ['/etc/os-release'] # add any other distro locations for os-release
def read_release():
for filename in filenames:
if os.path.isfile(filename):
with open('/etc/os-release', 'r') as relfile:
for line in relfile:
if('NAME ' in line):
release_dict(line.split(' ')[1])
@tcarrio
tcarrio / perfectelementary.bash
Last active February 5, 2016 16:56
ElementaryOS Setup
#Download Elementary OS from here:
#http://elementary.io
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
@tcarrio
tcarrio / gist:255d2969a41d5c426c9b
Last active December 11, 2015 20:52 — forked from mtroiani/gist:81ad68a1f19027086ed2
http://www.freecodecamp.com/mtroiani 's solution for Bonfire: Check for Palindromes
// Bonfire: Check for Palindromes
// Author: @mtroiani
// Challenge: http://www.freecodecamp.com/challenges/bonfire-check-for-palindromes
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function palindrome(str) {
str = str.toLowerCase().replace(/[^\w]|_/g, "");
return (str === str.split("").reverse().join(""));
}
@tcarrio
tcarrio / The Technical Interview Cheat Sheet.md
Created August 26, 2015 15:14 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.