Skip to content

Instantly share code, notes, and snippets.

@cnsoft
cnsoft / blogpost.md
Last active August 29, 2015 14:15 — forked from coryalder/blogpost.md

Save books out of Safari Books Online

From http://objectivesea.tumblr.com/post/9033067018/safaribooks

This is hard. I spent way too much time figuring this out, because I was annoyed that a book I bought (Addison-Wesley) was available online for free, except only for 45 days after which payment was required. So I made this hack... probably useful to no one else, but here it is.

Requirements:

  1. iPad.
  2. Safari To Go (the Safari Books Online iPad app).
resolver 8.8.8.8;
location /video/ {
if ($request_uri ~ "^/video/(.+?)/.+") {
set $upstream_host $1.googlevideo.com;
add_header Content-Disposition "attachment; filename=video.mp4;";
}
rewrite /video/.+?/(.+)$ /$1 break;
proxy_buffering off;
proxy_pass https://$upstream_host;
proxy_set_header Host $upstream_host;
#
# This config file is a combination of ideas from:
# http://www.37signals.com/svn/posts/1073-nuts-bolts-haproxy
# http://www.igvita.com/2008/05/13/load-balancing-qos-with-haproxy/
# http://wiki.railsmachine.com/HAProxy
# http://elwoodicious.com/2008/07/15/nginx-haproxy-thin-fastcgi-php5-load-balanced-rails-with-php-support/
# http://upstream-berlin.com/2008/01/09/using-haproxy-with-multiple-backends-aka-content-switching/
# http://wiki.railsmachine.com/HAProxy
# http://gist.github.com/raw/25482/d39fb332edf977602c183194a1cf5e9a0b5264f9
#
@cnsoft
cnsoft / DL.sh
Created February 20, 2014 03:41 — forked from schnabear/DL.sh
#!/bin/bash
while read link; do if [ ! -f "$(basename $link)" ]; then wget $link; fi; done < GDMAG.txt
#go to folder:
/Applications/Adobe Photoshop CS6/Locales/pt_BR/Support Files/tw10428.dat
#rename the file tw10428.dat for tw10428.bak
using Livity.Collections;
using Livity.Composition;
using Livity.Text.Logic;
using Livity.Text.UI.Engine;
using Livity.Text.UI.Engine.Internal;
using UnityEngine;
namespace Livity.Mine
{
[Export(typeof(IColorSchemeProvider))]
@cnsoft
cnsoft / brewv
Created January 17, 2014 06:01 — forked from MattiSG/brewv
#!/bin/bash
#
# Installs the previous version of a Homebrew formula
#
# Usage: brewv formula_name desired_version
#
# Based on http://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula#9832084
#
# Author: Matti Schneider <hi@mattischneider.fr> (http://mattischneider.fr)
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/* Author @jpsarda
* A drawing class.
*
* Examples :
*
public abstract class SingletonBehaviour<Interface> : MonoBehaviour
where Interface : class
{
private static Interface _instance = null;
public static Interface instance { get { return _instance; } }
void Awake()
{
System.Diagnostics.Debug.Assert(this is Interface);
/**
Converts Mobile Touch to the default Mouse Click
## invoked these method in Mobile too
OnMouseDown
OnMouseDrag
OnMouseUp
## only called in touch screen