Skip to content

Instantly share code, notes, and snippets.

View masnick's full-sized avatar

Max Masnick masnick

View GitHub Profile
@masnick
masnick / gist:4040131
Created November 8, 2012 17:11
Userscript to display unread badge on Fluid SSB for Gmail
function updateDockBadge() {
var link = $('a[title*=Inbox].n0').first().html();
var fromLink = /Inbox \(([0-9]+)\)/.exec(link);
if(fromLink == null) {
window.fluid.dockBadge = null;
console.log("C");
}
else {
window.fluid.dockBadge = fromLink[1];
console.log("D "+fromLink[1]);

Proceed at your own risk. Back up. Don't blame anyone but yourself if you lose all your email or send your personal information to a nefarious third party.

Source: http://hynek.me/articles/fleeing-from-gmail/

  1. On a VPS to increase speed (I used a Digital Ocean VPS):

     wget http://imaputils.googlecode.com/svn-history/r5/trunk/imapcopy.pl
    
  2. Create a text file called map with the following contents:

Make all your Trovebox photos private:

  1. Check out https://github.com/photo/openphoto-ruby (I used this commit) and bundle install
  2. Copy the gist below into a new file in the openphoto-ruby folder you checked out
  3. Run ruby trovebox_private.rb

Use at your own risk!

@masnick
masnick / example.png
Last active December 18, 2015 12:19
AppleScript to make a list of links for all the tabs in the frontmost window in an Evernote note.
example.png
@masnick
masnick / formats.sas
Last active December 19, 2015 01:29
Convert SAS formats to Stata labels.
value Fgender
1='male'
2='female';
value Fyesno
1='yes'
0='no';

Git is software that takes snapshots of a folder, lets you annotate these snapshots, and share the entire history of snapshots with other people.

It also allows multiple people to work on the same files without over-writing each other’s changes.

Some features, such as automatically combining the work of two people working on the same file at the same time, only work with plain text but git snapshots can include any type of file.

Getting started

  1. Read The Git Parable first. This will help you understand why Git (and version control in general) is important.
  2. Go through a setup/getting started tutorial like Git Immersion or Git Bootcamp from Github. This should take you through installing git, doing initial setup, and some basic command line usage. (Note that we have a Github account, but most of our repositories are on a private server.)
App.net: $36/year/month
iCloud storage: $20/year/month
AWS: $3/month
railscasts: $9/month
Use any downloads, software, or code on this site solely at your own risk.
DOWNLOADS, SOFTWARE, AND CODE ON THIS SITE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
@masnick
masnick / gist:6985205
Created October 15, 2013 01:30
Create an email message in Mail.app with this AppleScript. Callable from the Terminal.
on replace(input, find, replacement)
set text item delimiters to find
set ti to text items of input
set text item delimiters to replacement
ti as text
end replace
--Variables
on run argv
set recipientName to item 1 of argv
@masnick
masnick / gist:7363338
Last active December 27, 2015 17:39
Ulysses III double-spaced manuscript style
// Arial double
// (Based on Novel Cochin)
//
// By Max Masnick (http://masnick.org)
//
// Visit http://www.ulyssesapp.com/styles
// for full reference
//