This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is an example of using Object/Classes in Python. | |
# The code has been tested with Python 2.7. | |
# My Car Object | |
class ExampleCarObject: | |
# This is the constructor so when creating the object, these are | |
# the required parameters. "self" is needed as the first parameter | |
# for all functions in the object but when call it, you do NOT | |
# pass anything in. At the bottom there is an example. | |
def __init__(self, carOwner): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RPi.GPIO as GPIO | |
from time import sleep | |
GPIO.setmode(GPIO.BOARD) | |
Motor1A = 16 | |
Motor1B = 18 | |
Motor1E = 22 | |
GPIO.setup(Motor1A,GPIO.OUT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Given an array S of n integers, are there elements a, b, c in S such that | |
a + b + c = 0? Find all unique triplets in the array which gives the sum of | |
zero. Note, the solution must run in O(n^2logn) or O(n^2) time or better and | |
can use at most O(n) extra memory. | |
For example, given array S = [-1, 0, 1, 2, -1, -4], | |
A solution set is: | |
[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file will find keywords in the file name to assign tags for the | |
# Cascade Market. Add keywords to the image file name in the following | |
# format "..._keyword_keyword2.jpg". This is explained more below. | |
# | |
# | |
# Tips: | |
# - Keep it consistent. I made the mistake of labeling a mix of longboard and | |
# longboarder to represent the same thing. As a result, when I train I have | |
# to make sure the other is not in the negative set or it will affect my | |
# cascade. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Install using composer and run: $ composer require kweaver00/lumberjack_php dev-master | |
require_once "/vendor/autoload.php"; | |
$lumberjack = new \Kweaver\Lumberjack\Lumberjack(); | |
$lumberjack->setAppKey("YOUR_APP_KEY"); | |
$lumberjack->setAPIKey("YOUR_API_CODE"); | |
$lumberjack->log("TAG","Content goes here.", "Verbose"); | |
// Title, Content, Level of importance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Demo of using the ls command in Python | |
# https://stackoverflow.com/questions/4514751/pipe-subprocess-standard-output-to-a-variable | |
import subprocess | |
proc = subprocess.Popen('ls', stdout=subprocess.PIPE) | |
output = proc.stdout.read() | |
print output | |
# My terminal: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Demo of using the ls command in Python | |
# I have another one here: https://gist.github.com/keithweaver/f77c5001e6e38b7c8fa5a4fb1505bc73 | |
# But I really didn't want it to be the current path. I want to pass the path | |
# in. I found this example of listing all files in a path from SO: | |
# https://stackoverflow.com/questions/3207219/how-do-i-list-all-files-of-a-directory | |
# Works perfect. | |
from os import listdir | |
from os.path import isfile, join | |
mypath = '../'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 1AxH83ExEXXAwa86SASfSv3Pw1chXLAQNz https://explorer.blockstack.org/address/1AxH83ExEXXAwa86SASfSv3Pw1chXLAQNz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 13TYandebFM6qEWpekgneyCAmVGqgyibaM https://explorer.blockstack.org/address/13TYandebFM6qEWpekgneyCAmVGqgyibaM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 1MrmdPKc3xb38HfwZbeeLSM4r42RhNU4tG https://explorer.blockstack.org/address/1MrmdPKc3xb38HfwZbeeLSM4r42RhNU4tG |
OlderNewer