This file contains hidden or 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
| #!/bin/bash | |
| # current Git branch | |
| branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
| # v1.0.0, v1.5.2, etc. | |
| versionLabel=v$1 | |
| # establish branch and tag name variables | |
| devBranch=develop |
This file contains hidden or 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
| from time import sleep | |
| import RPi.GPIO as GPIO | |
| from pygame import mixer | |
| mixer.init() | |
| alert = mixer.Sound('bell.wav') | |
| GPIO.setmode(GPIO.BOARD) | |
| button1 = 16 |
This file contains hidden or 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
| #!/usr/bin/env python | |
| from ffprobe import FFProbe | |
| import glob, os | |
| os.chdir("/downloads") | |
| for file in glob.glob("*.avi"): | |
| metadata=FFProbe(file) | |
| for stream in metadata.streams: | |
| if stream.isVideo(): |
This file contains hidden or 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
| Description: | |
| Generates a basic rspec test template for rake after_party task | |
| Example: | |
| rails generate after_party_test 2019112233_your_task_name | |
| This will create: | |
| spec/lib/task/deploy/your_task_name_spec.rb |
This file contains hidden or 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 csv | |
| class CsvMapper(): | |
| """export database queries to csv""" | |
| def __init__(self, data): | |
| self.data = data | |
| self.headers = data['headers'] | |
| self.records = data['records'] | |
| def write_csv(self, destination): |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| if [[ "$OSTYPE" == "darwin"* ]] ; then | |
| if ! brew ls --versions pv &> /dev/null ; then | |
| echo "Pipe Viewer is NOT installed!" | |
| brew install pv | |
| fi | |
| else | |
| distro=$(source /etc/os-release && echo "$NAME"); |
This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int power(int base, int n){ | |
| int p; | |
| for(p = 1; n > 0; n-- ){ | |
| p = p * base; | |
| } |
OlderNewer