Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#probably needed to be run as plex user
export LD_LIBRARY_PATH="/usr/lib/plexmediaserver"
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/lib/plexmediaserver/Library/Application Support"
arg=$1
rtorrent_tv="/rtorrent/tv/"
union_tv="/union/tv/"
@wmoreland
wmoreland / matchcolors.py
Last active August 22, 2019 11:27 — forked from astanin/matchcolors.py
Match colors of the second image to the colors of the first image.
"""Usage: python matchcolors.py good.jpg bad.jpg save-corrected-as.jpg"""
from scipy.misc import imread, imsave
from scipy import mean, interp, ravel, array
import sys
def mkcurve(chan1,chan2):
"Calculate channel curve by averaging target values."
fst = lambda p: p[0]
snd = lambda p: p[1]
@rivo
rivo / chartcolorpalettes.js
Created January 22, 2016 11:24
Generating Color Palettes for Charts
var MIN_L = 40, // Don't generate too dark colors.
MAX_L = 85, // Don't generate too light colors.
index,
length,
offset,
emptySlots;
// Make a list of base colors. Start with blue if nothing is defined.
var baseColors = BASE_COLORS.length ? BASE_COLORS : ["RoyalBlue"];
emptySlots = FINAL_PALETTE_SIZE - baseColors.length - 2; // 2 gray values.
@adewes
adewes / README.md
Last active February 13, 2024 16:39
Ebay Ads - Bot. Because who wants to write messages by hand...

To use this bot:

  • Download ads_bot.py and requirements.txt.
  • Type pip install -r requirements.txt to install the requirements.
  • Fill out the required information in the Python file.
  • Ideally, create a (free) Slack account and set up a web hook to receive notifications from the bot.
  • Run the script :)
  • Relax and be ready to answer incoming calls :D
@artursapek
artursapek / mov2gif
Last active August 29, 2015 14:17
mov2gif
#!/bin/bash
# mov2giv in out width
# mov2gif video_file_in.mov gif_file_out.gif 300
tmp_dir=/tmp/frames_$(date +%s)
mkdir $tmp_dir
if [ -z "$3" ]
then
size=600
@mrinterweb
mrinterweb / svgoptimize
Created April 25, 2014 21:21
Command line SVG optimizer and base64 converter for CSS
#! /usr/bin/env ruby
# nokogiri is required below unless --no-modify option is specified
require 'optparse'
require 'tempfile'
@options = {}
OptionParser.new do |opts|
opts.banner = "Usage: svgoptimize [options] <path-to-svg-file>"
@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
# gem install crack rest-client fastercsv
require 'rubygems'
require 'crack'
require 'rest_client'
require 'fastercsv'
# To use, get an access token here, by clicking "get access token"
# and checking user.groups in the dialog box
# https://developers.facebook.com/tools/explorer?method=GET&path=209024949216061%2Ffeed
#
@orng
orng / jqb2d.js
Created December 11, 2012 11:15
jquery box2d bookmarklet helper
//Code by Örn Guðjónsson
// with a lot of help from Vincent Robert (http://stackoverflow.com/a/756526/611292)
function loadScript(url, callback)
{
var head = document.getElementsByTagName("head")[0];
var script = document.createElement("script");
script.src = url;
// Attach handlers for all browsers
var done = false;
@remy
remy / gist:2484402
Created April 24, 2012 22:45
jquery.marquee.js
/**
* author Remy Sharp
* url http://remysharp.com/tag/marquee
*/
(function ($) {
$.fn.marquee = function (klass) {
var newMarquee = [],
last = this.length;