Skip to content

Instantly share code, notes, and snippets.

View stve's full-sized avatar

Steve Agalloco stve

View GitHub Profile
@stve
stve / README.md
Created May 10, 2020 03:58 — forked from astamicu/Remove videos from Youtube Watch Later playlist.md
Script to remove all videos from Youtube Watch Later playlist

UPDATE 17.10.2019

Only works on old youtube skin.

//added "&disable_polymer=true" after playlist link

Also, saw this now, there is a "remove watched" button.

  1. Open your watch later playlist on youtube.
  2. Open the development console for your browser ( Ctrl+Shift+J for chrome, Ctrl+Shift+K for firefox )
@stve
stve / git-track
Created June 16, 2010 04:58 — forked from jamie/git-track
#!/usr/bin/env ruby
# Sets up remote tracking if you forgot to --track a branch,
# or if you're setting up a new branch.
# Save in ~/bin/ or somewhere else on your path.
# Usage:
# git track [[remote] branch]
# remote defaults to 'origin'
# branch defaults to the name of the current local branch
# MongoMapper "embedded document delete" plugin
# By Peter Cooper
#
# Got embedded documents you want to delete? You can delete them as if the
# embedded document collection were an array, but then there's no way to get
# a callback (as far as I could tell). This plugin gives you a call back
# (if you want it) and gives a nicer syntax to deleting embedded docs.
#
# Example:
#
.DS_Store
*.csv
*.pdf
@stve
stve / gist:375314
Created April 22, 2010 14:45 — forked from assaf/gist:291329
require "resque"
require "resque/failure/multiple"
require "resque/failure/redis"
# Configure Resque connection from config/redis.yml. This file should look
# something like:
# development: localhost:6379
# test: localhost:6379:15
# production: localhost:6379
Resque.redis = YAML.load_file(Rails.root + 'config/redis.yml')[Rails.env]
@stve
stve / gist:301188
Created February 11, 2010 03:46 — forked from tpitale/gist:162954
#! /bin/sh
### BEGIN INIT INFO
# Provides: mongodb
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the mongodb data-store
# Description: starts mongodb using start-stop-daemon
@stve
stve / no_www.rb
Created February 5, 2010 05:11 — forked from trevorturk/no_www.rb
class NoWWW
STARTS_WITH_WWW = /^www\./i
def initialize(app)
@app = app
end
def call(env)
if env['HTTP_HOST'] =~ STARTS_WITH_WWW
# app/controllers/posts_controller.rb
class PostsController < ApplicationController
def index
@posts.all_cached # Retrive only at once by every 5 minutes
expires_in 5.minutes, :private => false, :public => true
end
end
# app/models/post.rb
Class Post
# this script will migrate and reorganize a Paperclip attachments directory to utilize :id_partition
# Quickly put together by mario@orbitalvoice.com
# Assumes that your images to migrate < 1 000 000
#
# Usage: ruby paperclip_partition_id_migrate.rb TARGET_DIR=/path/to/attachments/:class/:style
require '/opt/ruby-enterprise/lib/ruby/1.8/fileutils.rb'
def add_leading_zeros(i)
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db