Skip to content

Instantly share code, notes, and snippets.

@hfeeki
hfeeki / build_openbr.sh
Last active August 26, 2016 01:16
Build openbr in ubuntu
# Install GCC 4.7.3
sudo apt-add-repository ppa:ubuntu-sdk-team/ppa
sudo apt-get update
sudo apt-get install -y build-essential
# Install CMake 2.8.10.1
sudo apt-get install -y cmake cmake-curses-gui
wget http://netcologne.dl.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.5/opencv-2.4.5.tar.gz
tar -xf opencv-2.4.5.tar.gz
@wopfel
wopfel / fswebcam-loop.sh
Created August 23, 2016 17:30
Save a webcam picture every x seconds (suitable for a timelapse). Created on a Raspberry Pi 3 running Arch Linux.
#!/bin/bash
# Exit script if /mnt is not mounted somewhere
# Prevents filling the root filesystem (/)
if ! mountpoint /mnt ; then
>&2 echo "Error: No mountpoint."
exit 1
fi
# Endless loop
require "rubygems"
require "twitter"
# get these from apps.twitter.com
CONSUMER_KEY = "abcd"
CONSUMER_SECRET = "abcd"
OAUTH_TOKEN = "abcd"
OAUTH_TOKEN_SECRET = "abcd"
TWITTER_USER = "your_username" # needs to be the one associated with keys above
@Daniel15
Daniel15 / 1_Twitter autoresponder bot.md
Last active December 6, 2021 20:37
Twitter autoresponder bot

Twitter autoresponder bot

By Daniel15 (dan.cx) This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.

Could be modified to be more advanced (match regular expressions to answer questions, etc.)

Questions? See my blog post - http://dan.cx/blog/2011/06/twitter-autoreply-bot-dbznappa

Modified 2013-06-13 - Twitter API 1.0 discontinued, modified to use Twitter API 1.1

@velocityzen
velocityzen / auth.py
Created September 26, 2011 16:30
This script take pictures from directory and post it to tumblr blog and then delete it. Tumblr API v2! This example for oath file upload.
import urlparse
import oauth2 as oauth
consumer_key = ''
consumer_secret = ''
request_token_url = 'http://www.tumblr.com/oauth/request_token'
access_token_url = 'http://www.tumblr.com/oauth/access_token'
authorize_url = 'http://www.tumblr.com/oauth/authorize'
@silverhammermba
silverhammermba / terrible.rb
Last active May 23, 2022 17:45
Generates word searches with only a single word to find, but every letter in the grid is in the word.
#!/usr/bin/env ruby
# terrible word search generator
# inspired by http://cnlohr.blogspot.com/2014/02/to-make-terrible-wordsearches.html
if ARGV.length != 3
STDERR.puts "usage: #$0 WIDTH HEIGHT WORD"
exit 1
end
$word = ARGV[2].upcase
@robinsloan
robinsloan / unfave.rb
Last active June 5, 2022 21:32
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
@flesueur
flesueur / deloldtweets.py
Created June 26, 2018 10:11
Delete (very) old tweets obtained from a twitter archive
#!/bin/python3
# Largely copied from http://www.mathewinkson.com/2015/03/delete-old-tweets-selectively-using-python-and-tweepy
# However, Mathew's script cannot delete tweets older than something like a year (these tweets are not available from the twitter API)
# This script is a complement on first use, to delete old tweets. It uses your twitter archive to find tweets' ids to delete
# How to use it :
# - download and extract your twitter archive (tweet.js will contain all your tweets with dates and ids)
# - put this script in the extracted directory
# - complete the secrets to access twitter's API on your behalf and, possibly, modify days_to_keep
# - delete the few junk characters at the beginning of tweet.js, until the first '[' (it crashed my json parser)
# - review the script !!!! It has not been thoroughly tested, it may have some unexpected behaviors...
@misterburton
misterburton / tumblr-delete-all-posts.js
Last active September 18, 2023 13:44
How to Delete All Tumblr Posts via JavaScript & the Browser Console
/*
Navitage to your mass post editor:
https://www.tumblr.com/mega-editor/[blog-name]
Open your browser's JavaScript Console and paste either of the following code snippets
*/
// delete 100 tumblr posts at a time (h/t Louis Lee: http://louisrli.github.io/blog/2013/05/11/how-to-delete-all-tumblr-posts/)
javascript:$('.overlay').slice(0, 100).click(); // you must now manually hit the 'delete' button at the top-right of the page
// delete all tumblr posts (h/t Hendry Sadrak [@hendrysadrak] a commenter on Li's above-linked post)
@MotionDesignStudio
MotionDesignStudio / ascii_movie_image_ver_1.py
Last active January 3, 2024 03:26
Python ASCII Video And ASCII Image Creator
#!/usr/bin/env python
import sys
import cv2
import subprocess
from subprocess import call
import aalib
import Image