Skip to content

Instantly share code, notes, and snippets.

on run {input, parameters}
-- RCF: Quick Action for folders in Finder.app
-- Opens a new terminal window within the passed folder.
set POSIXPath to POSIX path of input
set newDirCmd to ("cd " & POSIXPath & " && clear")
(* Your script goes here *)
tell application "Terminal"
on run {input, parameters}
-- RCF: Quick Action for folders in Finder.app
-- Opens a new terminal window within the passed folder.
-- V2: Opens for every selected folder.
if (exists input) then
repeat with folderPath in input
set POSIXPath to POSIX path of folderPath
#!/usr/bin/python3
import os
def crawlAndPullRepos():
issue_dirs = []
for dirname, subdirs, filenames in os.walk(os.getcwd()):
if '.git' in subdirs:
print("\nDirectory " + dirname + " is a git repository.")
output = os.system("cd " + dirname + " && git pull")
# Some useful OSX aliases for your .zshrc or .bash_aliases
alias np='Open /Applications/TextEdit.app' # Open the notepad for easier copy-pasting from terminal.
alias py='python3'
alias pyp='pip3'
alias pep8='autopep8 -i -a -a -a'
alias sp='python3 ~/RCF/sp.py'
@RyanFleck
RyanFleck / simplicity.html
Created July 8, 2019 14:05
Minimalist web design for an article.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Simplicity-1</title>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width,initial-scale=1,shrink-to-fit=no"
/>
<style>
@RyanFleck
RyanFleck / loc.py
Created July 10, 2019 15:01
Count lines of code for a given extension type in a repository.
#!/usr/bin/python3
# Takes file extension as first argument, counts lines of code.
import os
import sys
import re
def countLinesOfCode(extension):
print(r'(.*\.{}$)'.format(extension))
@RyanFleck
RyanFleck / Interrupt.ino
Last active September 21, 2019 21:39
Simple Interrupt
// Pin 13 has an LED connected on most Arduino boards.
const byte ledPIN = 13;
const byte interruptPIN = 2;
volatile boolean enabled;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(ledPIN, OUTPUT);
pinMode(interruptPIN, INPUT_PULLUP);
/*
Ryan Fleck
Interrupt Programming Tests
*/
// Light for testing feedback.
const byte ledPIN = 13;
// Interrupt pin zero is digital pin 2.
const byte interruptPIN = 2;
--- CEG3155 Lab 2 material.
library IEEE;
use IEEE.Std_Logic_1164.all;
entity halfadder is
port (
A, B : in std_logic;
sum, carry : out std_logic
);
import random
while(True):
x = input(">>> ")
x = list(x)
y = []
for char in x:
if char == " ":
y.append(" ")
else: