Skip to content

Instantly share code, notes, and snippets.

View lukeholder's full-sized avatar
👾

Luke Holder lukeholder

👾
View GitHub Profile
@lukeholder
lukeholder / das_download.rb
Last active October 12, 2022 01:32 — forked from itsgoingd/das_download.rb
Script to download all Destroy All Software screencasts w/ login (works as of Apr 2021)
#! /usr/bin/env ruby
# usage:
# $ das_download.rb email password
# based on various gists from this thread https://gist.github.com/maca/1798070
require "mechanize"
require "nokogiri"
require "fileutils"
class DasDownloader
<?php
namespace Craft;
$craft = require '../craft/app/bootstrap.php';
$craft->plugins->loadPlugins();
$productIds = craft()->elements->getCriteria('Commerce_Product', ['limit' => null])->ids();
// Configuration
var randomNumbers = [42, 12, 88, 62, 63, 56, 1, 77, 88, 97, 97, 20, 45, 91, 62, 2, 15, 31, 59, 5]
func partition(v: Int[], left: Int, right: Int) -> Int {
var i = left
for j in (left + 1)..(right + 1) {
if v[j] < v[left] {
i += 1
(v[i], v[j]) = (v[j], v[i])
}
}
{% set username = craft.request.getSegment(3) %}
{% set author = craft.users.username(username).first() %}
<p>Articles written by <strong>{{ author.firstName }} {{ author.lastName }}</strong></p>
{% paginate craft.entries.section('blog').limit(5).authorId(author.id) as entries %}
{% for entry in entries %}
<article>
<h1><a href="{{ entry.url }}">{{ entry.title }}</a></h1>
@lukeholder
lukeholder / anonymous.js
Last active December 16, 2015 07:49 — forked from anonymous/anonymous.js
This script redirects all the links via blankrefer.com - except for the sites that were included in the protected_links string
//This script redirects all the links via blankrefer.com - except for the sites that were included in the protected_links string
//Example:
//var protected_links = "myspace,ebay";
var protected_links = "";
var a_to_va = 0;
var a_to_vb = 0;
var a_to_vc = "";
function blank_refer()
{
@lukeholder
lukeholder / sharing.md
Created December 4, 2012 07:46 — forked from danott/sharing.md
Sharing Buttons Reference

Pinterest

Documentation

<!-- An individual link -->
<a href="http://pinterest.com/pin/create/button/?url=http%3A%2F%2Funitedway.com&media=http%3A%2F%2Fplacehold.it%2F200x200&description=A%20description." class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>

<!-- before </body> -->
@lukeholder
lukeholder / redis install
Created September 27, 2012 01:57 — forked from antond/redis install
redis install on CentOS
1.CentOS 6.3
#yum install make gcc
#cd /opt
$wget http://redis.googlecode.com/files/redis-2.x.xx.tar.gz
$tar zxf redis-2.x.xx.tar.gz
$cd redis-2.x.xx
$make
$make install
//////
@lukeholder
lukeholder / peepcode.rb
Created April 9, 2012 22:33 — forked from gertig/peepcode.rb
A script to download all Peepcode screencasts with ruby & wget (supports resume)
require 'mechanize'
@username = 'username@email'
@password = 'password'
@download_path = File.expand_path 'downloads'
@wget_cookie = File.expand_path(File.dirname(__FILE__)) + '/wget-cookies.txt'
unless File.directory? @download_path
puts "@{download_path} doesn't exist!"
exit
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal