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 PIL import Image, ImageDraw, ImageFont | |
# Offset for shadowed text. It's this amount lower than its y position | |
shadowed_color_y_offset = 55 | |
def draw_shadowed_text(draw, y, text, font, width, fill=(0, 0, 0), stroke_width=3, stroke_fill=(0, 0, 0), shadow_x=-1, shadow_y=1, steps=10): | |
"""Draw text centered horizontally at specified y position.""" | |
_, _, w, h = draw.textbbox((0, 0), text, font=font) | |
x = (width - w) / 2 |
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
// ==UserScript== | |
// @name Better Free Slack | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description Hides advertisements in free Slack | |
// @author Jeffery B <me@meandmybadself.com> | |
// @match https://app.slack.com/* | |
// @grant none | |
// ==/UserScript== |
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
function filterNGPVANSpam() { | |
// Look for emails containing "unsubscribe" sent in the past week. | |
// This'll be more than just NGPVAN emails. We'll look in their headers below. | |
const lastWeek = new Date((new Date()).getTime() - 604800000) | |
const lastWeekStr = lastWeek.getFullYear() + '/' + (lastWeek.getMonth()+1) + '/' + lastWeek.getDate() | |
// The gmail query "unsubscribe after: DATE" | |
const query = 'unsubscribe after:' + lastWeekStr | |
// Search for any email thread that meets this criteria. | |
const threads = GmailApp.search(query) | |
for(let i=0; i < threads.length; i++) { |
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
// Get users' names & skills from a devpost participants page. | |
// eg, https://slack.devpost.com/participants | |
let output = '' | |
document.querySelectorAll('div.participant').forEach(el => { | |
try { | |
const name = el.querySelector('h5 .user-profile-link').innerText | |
if (name) { | |
const skills = [...el.querySelectorAll('span.recognized-tag')].map(el => el.innerText.toLowerCase().replace(/\s+/g, '-')) | |
if (skills.length) { |
This file has been truncated, but you can view the full file.
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
! Ported from https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | |
! Title: StevenBlack/hosts | |
! | |
! This hosts file is a merged collection of hosts from reputable sources, | |
! with a dash of crowd sourcing via GitHub | |
! | |
! Date: 30 December 2021 19:03:10 (UTC) | |
! Number of unique domains: 100,621 | |
! | |
! Fetch the latest version of this file: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts |
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
[ | |
{ | |
"id": "5160", | |
"h": 1, | |
"w": 2.625, | |
"color": "White", | |
"count": 30 | |
}, | |
{ | |
"id": "8160", |
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
# Run as su | |
# Kill Apache. | |
sudo apachectl -k stop | |
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist | |
curl -OL http://nginx.org/download/nginx-1.14.0.tar.gz | |
tar -xvzf nginx-1.14.0.tar.gz | |
# PCRE for doing regex in nginx |
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
/** | |
Parts: | |
- Particle Photon (wireless Arduino): | |
https://store.particle.io/collections/wifi/products/photon | |
- RGB LEDs: | |
https://www.amazon.com/gp/product/B00ZHB9M6A/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&psc=1 | |
- Logic Level shifter (makes the 3.3v Photon play nice w/ the 5V RGB LEDs) | |
https://www.amazon.com/gp/product/B00NAY3J7O/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1 |
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
// See https://github.com/technobly/Particle-NeoPixel | |
#include <neopixel.h> | |
// Needed for ceil / floor | |
#include <math.h> | |
#define ONE_DAY_MILLIS (24 * 60 * 60 * 1000) | |
unsigned short PIXELS_PER_SEGMENT = 9; | |
unsigned short SEGMENTS_PER_CHAR = 7; |
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
http { | |
index index.html; | |
server { | |
server_name www.domain.com domain.com | |
access_log logs/www.domain.com.access.log main; | |
root /var/www/www.domain.com/; | |
} | |
} |
NewerOlder