Skip to content

Instantly share code, notes, and snippets.

View protrolium's full-sized avatar

Ꮹανiη Ꮐaмвoα protrolium

View GitHub Profile
@dnlcrl
dnlcrl / caffe+tensorflow+el-capitan.sh
Created January 26, 2016 12:52
fix incompatibility between tensorflow and caffe on OSX 10.11 el capitan, due to the different protobuf versions, installed by brew for caffe and by pip for tf
# follow instructions on http://caffe.berkeleyvision.org/install_osx.html except for protobuf, where you should use --devel and not use --with-python because it is the default behaviour
brew install --devel protobuf #basically you are installing protobuf 3.0, the same checked by pip for tensorflow
# continue with caffe installation, after make all and before make runtest, set the right linking lib location
install_name_tool -change libcaffe.so.1.0.0-rc3 @rpath/libcaffe.so.1.0.0-rc3 .build_release/test/test_all.testbin
install_name_tool -change libcaffe.so.1.0.0-rc3 @rpath/libcaffe.so.1.0.0-rc3 .build_release/tools/caffe
install_name_tool -change libcaffe.so.1.0.0-rc3 @rpath/libcaffe.so.1.0.0-rc3 .build_release/lib/libcaffe.so
# run make runtest, if everything is ok, before running make pycaffe set the right linking location for python
install_name_tool -change libcaffe.so.1.0.0-rc3 @rpath/libcaffe.so.1.0.0-rc3 /Users/imac/caffe/python/caffe/_caffe.so
# make pycaffe; cd caffe/python; try to run python >>>impor
@bennylope
bennylope / ffmpeg-watermark.md
Created April 22, 2016 23:17 — forked from webkader/ffmpeg-watermark.md
FFmpeg add a watermark to video

How to Add a Watermark to Video

FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.

Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.

@grrowl
grrowl / Twitter.gs
Created April 27, 2016 08:26
Google Docs script to automate Twitter posting
// source: https://ctrlq.org/code/19702-twitter-image-upload
function autoTweet() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("schedule"); // This must match the sheet name!
var rows = sheet.getRange("A:D").getValues();
var titleList = [], newValues = [],
response, doc, title;
var twitterCallback = function(rowIndex, err, result) {
@manuchandel
manuchandel / tweet_dumper.py
Created June 30, 2016 09:00 — forked from yanofsky/LICENSE
A script to download all of a user's tweets into JSON
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import json
import sys
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
@james2doyle
james2doyle / get-script-promise.js
Created November 17, 2016 18:37
Async load a script in the page and run it. Uses promises
// this function will work cross-browser for loading scripts asynchronously
function loadScript(src) {
return new Promise(function(resolve, reject) {
const s = document.createElement('script');
let r = false;
s.type = 'text/javascript';
s.src = src;
s.async = true;
s.onerror = function(err) {
reject(err, s);
@scottopell
scottopell / fix_exfat_drive.md
Last active March 26, 2025 09:24
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

If Disk Utility is unable to repair, consider trying this:

  1. In Disk Utility, ensure that the drive is not mounted, eject it if it is mounted.
  2. Use diskutil list to find the right drive id.
  3. You want the id under the IDENTIFIER column, it should look like disk1s1
  4. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  5. -d is debug so you'll see all your files output as they're processed.
@jarmitage
jarmitage / startup.scd
Created April 12, 2017 22:58
SuperDirt Startup for Multichannel Audio Output

( // http://doc.sccode.org/Classes/ServerOptions.html

s.options.numBuffers = 1024 * 16; // increase this if you need to load more samples s.options.memSize = 8192 * 16; // increase this if you get "alloc failed" messages s.options.maxNodes = 1024 * 32; // increase this if you are getting drop outs and the message "too many nodes"

// Default // s.options.numOutputBusChannels = 2; // set this to your hardware output channel size, if necessary // s.options.numInputBusChannels = 2; // set this to your hardware output channel size, if necessary

@phillmv
phillmv / extract.js
Created September 22, 2017 16:33
Mass embed twitter threads
// Open the Chrome inspector, and select the topmost div containing the twitter thread.
// You might want to open the first tweet in the thread, scroll down to load every item in the thread, then select the parent container
var foo = document.createElement("div");
var str = ""
$($0).find(".tweet").each(function(i, t) {
var tweet = $(t);
var turl = "https://twitter.com" + tweet.data("permalink-path")
var tdate = tweet.find(".tweet-timestamp").attr("title")
var tcontent = tweet.find(".tweet-text").html()