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
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) |
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
# 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" |
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 UIKit | |
extension UIImage { | |
public func fixedOrientation() -> UIImage { | |
if imageOrientation == UIImageOrientation.up { | |
return self | |
} |
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 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): |
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
#!/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 |
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
var appServer = require('./index'); | |
appServer.start({ port: process.env.PORT || 3000, debug: true }); |
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
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. |
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
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!"); | |
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 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 = "}"; |