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
(defun cracklepop (num) | |
(cond | |
((and (= (mod num 3) 0) (= (mod num 5) 0)) "CracklePop") | |
((= (mod num 3) 0) "Crackle") | |
((= (mod num 5) 0) "Pop") | |
(num))) | |
(loop for val from 1 below 100 do (print (cracklepop val))) |
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
require "csv" | |
for c in CSV.foreach("cafes.csv", :quote_char => '"', :col_sep =>', ', :headers => true) | |
slug = c['place_name'].downcase.gsub(/[^a-z0-9]+/i, '-') | |
front_matter = " | |
--- | |
layout: checkin | |
latitude: #{c["lat"]} | |
longitude: #{c["long"]} |
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 requests | |
HEADERS = { | |
"User-agent": "YOUR USER AGENT" | |
} | |
SITE_URL = "jamesg.blog" | |
def find_robots_directives(): | |
""" |
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
require "keybow" | |
muted = false | |
-- this code lets me press multiple keys at once (use a keyboard shortcut) | |
-- I found the modifier function online but cannot remember the source | |
function modifier(key, ...) | |
for i = 1, select('#', ...) do | |
local j = select(i, ...) |
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
# Written by capjamesg | |
# Required dependencies: requests, beautifulsoup4 | |
from bs4 import BeautifulSoup | |
import requests | |
# Please save your opml file as feed.opml before running this program, otherwise you'll encounter an error | |
with open("feed.opml", "r") as file: | |
contents = file.read() |
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 mf2py | |
import main | |
import requests | |
import os | |
from Adafruit_Thermal import * | |
printer = Adafruit_Thermal("/dev/serial0", 19200, timeout=5) | |
printer.setLineHeight(28) |
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/bash | |
rm /home/james/logs/* | |
log_files=/home/james/logs/ | |
# Copy log files to temporary directory | |
cp /var/log/nginx/access*.gz $log_files |
NewerOlder