Skip to content

Instantly share code, notes, and snippets.

View ljcooke's full-sized avatar

Liam Cooke ljcooke

View GitHub Profile
@IanColdwater
IanColdwater / twittermute.txt
Last active July 29, 2024 08:50
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@ckipp01
ckipp01 / function-examples.js
Last active August 22, 2019 07:23
Javascript function examples
'use strict'
/*
This is meant to be a concise explanation on the difference between
functions declaration, function expressions, and es6 fat arrow functions
You should be able to just clone this or paste it in a file and run `node <filname>`
*/
/*
@jimfoltz
jimfoltz / tw5-server.rb
Last active February 26, 2024 02:18
A local server for TiddlyWiki5 that allows saving wiki.
require 'webrick'
require 'fileutils'
if ARGV.length != 0
root = ARGV.first.gsub('\\', '/')
else
root = '.'
end
BACKUP_DIR = 'bak'
@jozsefsallai
jozsefsallai / GoHTML.sublime-syntax
Last active July 26, 2024 19:17
Go HTML template syntax highlighting for Sublime Text
%YAML 1.2
---
name: 'GoHTML'
file_extensions:
- gohtml
- html.go
scope: text.html.gohtml
contexts:
main:
- match: ''
@cblgh
cblgh / dat-quickstart.md
Last active May 1, 2018 19:29
make the p2p web with dat's primitives

low level primitives (in ascending abstraction)

  • hypercore works with individual posts in an append-only feed
  • hyperdrive abstracted filestore / works with files
  • hyperdiscovery create p2p swarms for hypercores, hyperdrives, and hyperdbs
  • hyperdb key-value database

higher level abstractions

  • webdb database; basically a document(?) store
  • dat-node built ontop of hypercore & hyperdrive, abstracts a bunch of stuff; less complex but also less flexible
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active July 30, 2024 15:11
Hyperlinks in Terminal Emulators
@aparrish
aparrish / index.md
Last active May 6, 2023 14:29
Getting credentials for the Mastodon API with Mastodon.py. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/

Getting credentials for the Mastodon API with Mastodon.py, step by step

Making a bot? Making a bot in Python? Making a bot in Python that uses the Mastodon API? If so, chances are you need to get some credentials. Here's how I did it!

(The following tutorial uses Python 2.7, but if you're using Python 3+ everything should work substantially the same.)

Mastodon.py authentication

I just started using it, but it looks like Mastodon.py is a pretty great library for working with the Mastodon API! However, all of the authentication examples use static files to store credentials, which I don't like—I'm afraid I'll accidentally push them to Github. I like to keep my authentication as close to the actual command that runs the program as possible, so usually I pass them on the command line to the script running my bot. To do this, I need to get the appropriate credentials on their own, as separate strings that I can cut and paste.

@adeekshith
adeekshith / .git-commit-template.txt
Last active July 25, 2024 10:26 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@d-baker
d-baker / pseudomarkov.py
Created November 3, 2015 12:58
word chainer made for nanogenmo 2014. not a markov chain.
import random
class PseudoMarkov():
def __init__(self):
self.associations = {}
# pass it the corpus filepath
def gen(self, filepath):
sentences = []
@JKirchartz
JKirchartz / convert.sh
Created November 2, 2015 18:41
Download Sherlock Novels to make corpora for NaNoGenMo15
#! /bin/sh
#
# convert.sh
#
# Copyleft (ↄ) 2015 jkirchartz <jkirchartz@gmail.com>
#
# Distributed under terms of the NPL (Necessary Public License) license.
#
for file in ./sources/*.txt; do