Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
declare module Cesium {
type RenderState = any;
interface Proxy {
getURL(resource: string): string;
}
class ArcGisImageServerTerrainProvider {
@mbostock
mbostock / .block
Last active September 30, 2016 16:15
Reprojecting CSV with ogr2ogr
license: gpl-3.0
@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@cdiener
cdiener / asciinator.py
Created April 13, 2014 03:11
asciinator.py now with documentation
# This line imports the modules we will need. The first is the sys module used
# to read the command line arguments. Second the Python Imaging Library to read
# the image and third numpy, a linear algebra/vector/matrix module.
import sys; from PIL import Image; import numpy as np
# This is a list of characters from low to high "blackness" in order to map the
# intensities of the image to ascii characters
chars = np.asarray(list(' .,:;irsXA253hMHGS#9B&@'))
# Check whether all necessary command line arguments were given, if not exit and show a
@cobyism
cobyism / gh-pages-deploy.md
Last active April 18, 2024 13:44
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@jkosoy
jkosoy / gist:3895744
Created October 15, 2012 21:42
Cinder Drawing Tips
// originally from http://redpaperheart.com/blog/2012/08/handy-snippets-for-drawing-image-textures-in-cinder/
// thanks Daniel!
// ---------------------
/* draw a texture */
gl::draw(texture);
// ---------------------
/* Draw a texture into a specified rectangle, distort texture to fill rectangle: */
@mgiraldo
mgiraldo / 960grid.css.scss
Created May 15, 2012 17:27
SCSS implementation of the 960.gs grid based on the SASS version found in https://github.com/nextmat/compass-960-plugin
$ninesixty-gutter-width: 20px !default;
$ninesixty-grid-width: 960px !default;
$ninesixty-columns: 12 !default;
$ninesixty-class-separator: "_" !default;
@mixin grid-container {
margin-left: auto;
@croaky
croaky / gist:1089598
Created July 18, 2011 14:01
Transfer data from production to staging on Heroku
heroku addons:add pgbackups --remote staging
heroku addons:add pgbackups --remote production
heroku pgbackups:capture --remote production
heroku pgbackups:restore DATABASE `heroku pgbackups:url --remote production` --remote staging
@emacsen
emacsen / mb2s3.py
Created May 1, 2011 21:16
First rough cut at an mbtiles to s3 uploader. Needs work
#!/usr/bin/env python
"""Script to upload contents of an mbtile to an s3 storage bucket"""
from boto.s3.connection import S3Connection
import sqlite3
import sys
import os
import progressbar
import threading