Skip to content

Instantly share code, notes, and snippets.

View nicksahler's full-sized avatar
🏪
Dreaming of bodegas

Nick nicksahler

🏪
Dreaming of bodegas
View GitHub Profile
# -*- coding: utf-8 -*-
""" Deletes all tweets below a certain retweet threshold.
"""
import tweepy
from datetime import datetime
# Constants
CONSUMER_KEY = ''
@vmdowney
vmdowney / harvard-iiif-jigsaws.md
Last active October 13, 2021 13:13
Harvard Digital Collections IIIF online jigsaw puzzles

Creating online jigsaw puzzles from Harvard Digital Collections images

These instructions were adapted from tweets by Emma Stanford on using Bodleian Library IIIF images to create online jigsaw puzzles: https://twitter.com/e_stanf/status/1233102000151126017.

  1. Find an image in Harvard Digital Collections: https://library.harvard.edu/digital-collections. Here is an example image, MS Thr 495 (319) from the Harvard Theatre Collection:
https://id.lib.harvard.edu/digital_collections/hou01892c00350
  1. Click Copy Manifest Link in the Tools & Related Links panel. The link should like this:
@garmjs
garmjs / server.js
Last active July 29, 2022 17:16
Simple SSR React, React Router v4 and Helmet with express
require('babel-register')
const express = require('express')
const React = require('react')
const ReactDOMServer = require('react-dom/server')
const ReactRouter = require('react-router')
const ServerRouter = ReactRouter.ServerRouter
const App = require('./src/App').default
const path = require('path')
const Helmet = require('react-helmet')
const compression = require('compression')
#!/bin/sh
# This pre-commit hook will prompt for every file that contains a `console.log`, `debugger`
# or `puts` statement. This should avoid stupidly commiting debugging information :)
exec < /dev/tty
confirm() {
echo "${1:-Are you sure? [y/N]}"
read -r response
@evan-goode
evan-goode / weather-emoji.sh
Created February 10, 2016 03:30
returns an emoji representing the current weather conditions in a specified location
#!/bin/bash
woeid="2390183"
weather=`curl --silent "http://xml.weather.yahoo.com/forecastrss?w=${woeid}&u=f" | xmllint --xpath "string(//*[local-name()='condition']//@code)" -`
# codes from https://developer.yahoo.com/weather/documentation.html#codes
case "$weather" in
0) # tornado
emoji="🌪" # cloud with tornado
;;
@TheZoc
TheZoc / mp3-to-m4r.bat
Created June 25, 2015 02:51
Convert a MP3 file to an Apple iPhone's ringtone file (M4R), using FFMPEG.
@echo off
rem =====================================================
rem Converts a MP3 file to a M4R file using ffmpeg.
rem Usage: Drop a MP3 file at the top of this batch file.
rem =====================================================
set ffmpeg_exe="C:\ffmpeg\ffmpeg-20150619-git-bb3703a-win64-static\bin\ffmpeg.exe"
rem %~f1 = Full File Path, with drive letter
rem %~p1 = Drive Letter
rem %~p1 = Path Only
@ndarville
ndarville / webm.md
Last active September 30, 2023 18:56
4chan’s guide to converting GIF to WebM - https://boards.4chan.org/g/res/41212767

Grab ffmpeg from https://www.ffmpeg.org/download.html

It's a command line tool which means you will have to type things with your keyboard instead of clicking on buttons.

The most trivial operation would be converting gifs:

ffmpeg -i your_gif.gif -c:v libvpx -crf 12 -b:v 500K output.webm
  • -crf values can go from 4 to 63. Lower values mean better quality.
  • -b:v is the maximum allowed bitrate. Higher means better quality.
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@sandfox
sandfox / CertificateGeneration.sh
Created February 15, 2012 00:11
TLS certificate inspection example (using nodejs)
###
#Step 1 - Generate server certificates etc... (most of this code is horribly ripped off from nodejs docs currently -> http://nodejs.org/docs/latest/api/tls.html)
###
#Assuming your starting from a clean directory
mkdir server
cd server
#generate private key