Skip to content

Instantly share code, notes, and snippets.

View codyphobe's full-sized avatar
🏍️
Chasing the sunset

Cody codyphobe

🏍️
Chasing the sunset
View GitHub Profile
@codyphobe
codyphobe / torrents.md
Created March 1, 2023 20:22 — forked from shmup/torrents.md
transmission blocklist guide

Transmission Blocklist

The Transmission torrent client has an option to set a Blocklist, which helps protect you from getting caught and having the DMCA send a letter/email.

It's as simple as downloading and installing the latest client:

@codyphobe
codyphobe / getBlockLists.sh
Created March 1, 2023 20:22 — forked from johntyree/getBlockLists.sh
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@codyphobe
codyphobe / PopularCrates.md
Created December 29, 2022 07:23 — forked from jrmuizel/PopularCrates.md
Popular crates
@codyphobe
codyphobe / FixMeTest.php
Last active May 29, 2022 06:44 — forked from inxilpro/FixMeTest.php
CI test that fails when any `FIXME` comments are found
<?php
namespace Tests\Project;
use RecursiveCallbackFilterIterator;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use SplFileInfo;
use Tests\Constraints;
use Tests\TestCase;
@codyphobe
codyphobe / langoliers.rb
Created April 13, 2022 01:44 — forked from robinsloan/langoliers.rb
The Langoliers, a tweet deletion script
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = "your_username"
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted
# get these from dev.twitter.com
CONSUMER_KEY = "your_consumer_key"
package no.jckf.slplib;
import java.io.*;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketException;
import java.nio.charset.Charset;
public final class MinecraftServer {
private String address = "localhost";
@codyphobe
codyphobe / unfave.rb
Created February 15, 2020 22:08 — forked from robinsloan/unfave.rb
Unfave script, because why not??
#!/usr/bin/env ruby
require "rubygems"
require "twitter"
require "json"
require "faraday"
# things you must configure
TWITTER_USER = "your_username"
# get these from dev.twitter.com
@codyphobe
codyphobe / SingletonModel.php
Created February 15, 2020 04:42 — forked from mpociot/SingletonModel.php
Making it easier to work with single row models in Laravel
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class SingletonModel extends Model
{
protected function store($data = [])
{
@codyphobe
codyphobe / isSunUp.php
Last active February 28, 2020 22:41 — forked from bramus/isSunSup.php
A standalone PHP function to check whether or not the Sun is above the horizon in a given location and time
<?php
function isSunUp(\DateTime $when, $lat, $lon): bool
{
$whenTimestamp = $when->getTimestamp();
[$sunriseTimestamp, $sunsetTimestamp] = array_map(function ($f) use ($whenTimestamp, $lat, $lon) {
return $f($whenTimestamp, SUNFUNCS_RET_TIMESTAMP, $lat, $lon);
}, ['date_sunrise', 'date_sunset']);