Skip to content

Instantly share code, notes, and snippets.

View slgraff's full-sized avatar

Steve Graff slgraff

  • GitHub
  • Durham, NC
  • 19:31 (UTC -12:00)
View GitHub Profile
def print_operation_table(operation, num_rows=6, num_columns=6):
for x in range(1, num_rows + 1):
nums = []
for y in range(1, num_columns + 1):
num = operation(x, y)
nums.append(num)
print(*[str(x) for x in nums])
print_operation_table(lambda x, y: x * y)
@bashbunni
bashbunni / .zshrc
Created October 27, 2022 21:41
CLI Pomodoro for Mac
# I'll be doing another one for Linux, but this one will give you
# a pop up notification and sound alert (using the built-in sounds for macOS)
# Requires https://github.com/caarlos0/timer to be installed
# Mac setup for pomo
alias work="timer 60m && terminal-notifier -message 'Pomodoro'\
-title 'Work Timer is up! Take a Break 😊'\
-appIcon '~/Pictures/pumpkin.png'\
-sound Crystal"
@matthiasnagel
matthiasnagel / UIImageFixedOrientationExtension.swift
Created January 19, 2017 09:36 — forked from schickling/UIImageFixedOrientationExtension.swift
Extension to fix orientation of an UIImage (Sets orientation to portrait)
import UIKit
extension UIImage {
public func fixedOrientation() -> UIImage {
if imageOrientation == UIImageOrientation.up {
return self
}
@xenic
xenic / hangman.py
Created January 18, 2017 00:31
2017_01_17 TIY-Durham Crash Course Hangman
import random
def get_hidden_word():
f = open("/usr/share/dict/words")
word_list = []
for line in f:
word_list.append(line.strip())
return random.choice(word_list)
def draw_board(hw, gl):
#!/bin/sh
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
sudo find /private/var/folders/ -name com.apple.iconservices -exec rm -rf {} \;
sudo rm -rf /Library/Caches/com.apple.iconservices.store
var appServer = require('./index');
appServer.start({ port: process.env.PORT || 3000, debug: true });
@primaryobjects
primaryobjects / index.js
Created August 24, 2016 14:45
Your first Amazon Alexa skill: Hello World. Running on alexa-app-server.
var alexa = require('alexa-app');
// Create a skill.
var hello = new alexa.app('hello');
// Launch method to run at startup.
hello.launch(function(req,res) {
res.say("Ask me to say hi!");
// Keep session open.
@primaryobjects
primaryobjects / index.js
Last active December 29, 2016 05:16
Your first Amazon Alexa skill: Hello World. Running on chatskills.
var chatskills = require('chatskills');
var readlineSync = require('readline-sync');
// Create a skill.
var hello = chatskills.app('hello');
// Launch method to run at startup.
hello.launch(function(req,res) {
res.say("Ask me to say hi!");
@bzdgn
bzdgn / GenerateDummyCode.java
Last active April 8, 2024 13:36
Dummy Code Generator : 10000 Lines of Useless Code
import java.io.FileNotFoundException;
import java.io.PrintWriter;
public class GenerateDummyCode {
public static void main(String[] args) {
String className = "Eben";
String newLine = "\n";
String tab = "\t";
String classStart = "public class " + className + " {";
String closeBracket = "}";