Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
# Description: http://daringfireball.net/2010/08/open_urls_in_safari_tabs
# License: See below.
# http://gist.github.com/507356
use strict;
use warnings;
use URI::Escape;
@BenWard
BenWard / pinboard-full.js
Created January 29, 2011 07:47
A smarter bookmarklet for Pinboard.in; wraps selected text in <blockquote> tags, keeps variables out of the global scope, supports filling tags from rel="tag" markup in the page, and titles from hAtom entry titles.
(function() {
// Change `silent` to true to invoke the promptless, self-closing
// version of the bookmarklet.
var silent = false;
var url = location.href;
var title = document.title;
// Look for a single hAtom entry on the page, and iff one is found, extract
// the entry-title in place of the document title:
@darkhelmet
darkhelmet / readability-bookmarklet.js
Created February 16, 2011 19:39
Original readability bookmarklet
javascript:(function(){readConvertLinksToFootnotes=false;readStyle='style-newspaper';readSize='size-medium';readMargin='margin-wide';_readability_script=document.createElement('script');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());document.documentElement.appendChild(_readability_script);_readability_css=document.createElement('link');_readability_css.rel='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';_readability_css.media='all';document.documentElement.appendChild(_readability_css);_readability_print_css=document.createElement('link');_readability_print_css.rel='stylesheet';_readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css';_readability_print_css.media='print';_readability_print_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_prin
@mages
mages / gist:1694442
Created January 28, 2012 14:15
Say it in R with by, apply and friends
## Markus Gesmann, January 2012
## Please install the following R packages first:
## data.table, doBy, plyr, reshape, sqldf, e.g. via
## install.packages(c("data.table", "doBy", "plyr", "reshape", "sqldf"))
f <- function(x) x^2
sapply(1:10, f)
do.call("rbind", as.list(
by(iris, list(Species=iris$Species), function(x){
@henrik
henrik / bookmarklet.js
Last active August 28, 2016 08:22
Bookmarklet to enable saving full-size(?) images from Houzz.com.
// When triggered, adds a small image before other images that represents the full-size image.
// Drag-and-drop it, right-click and save, or click to open.
javascript:$("img.viewImage, img.currentImage, img.space, img[id^=galleryImg], img[class^=browseListImage], .gallery-photo img").each(function() { var newSrc = this.src.replace(/[fs]images\/(\d+).*/, 'simages/$1_0_9-.jpg'); $(this).parents("a").andSelf().first().before("<a href='"+newSrc+"'><img src='"+newSrc+"' width=50></a>") })
@yichao0319
yichao0319 / feed43:ck101
Last active September 28, 2016 03:14
feed43:卡提諾
<li class="cartoon-img">{*}<a href="{%}" title="{%}">{*}<img src="{%}" title="{*}" alt="{*}" src="{*}" alt="Bad Image" onError="this.src='{*}';"/>{*}</a>{*}<h6><a target="_blank" href="{*}" title="{*}"><strong>{*}</strong></a></h6>{*}<p>{*}<em>{*}</em></p>{*}</li>
@tuzz
tuzz / github.css
Last active April 23, 2024 15:47
Github Markdown Stylesheet
/*
Copyright (c) 2017 Chris Patuzzo
https://twitter.com/chrispatuzzo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@beh
beh / gist:3549933
Created August 31, 2012 07:40
Add bookmark to pinbord.in with predefined tag, without user intervention
javascript:q=location.href;if(document.getSelection){d=document.getSelection();}else{d='';};p=document.title;void(open('https://pinboard.in/add?later=yes&noui=yes&jump=close&tags=TAGS GO HERE&url='+encodeURIComponent(q)+'&description='+encodeURIComponent(d)+'&title='+encodeURIComponent(p),'Pinboard','toolbar=no,width=100,height=100'));
// Copy and paste the above into a new bookmark. Replace "TAGS GO HERE" with your tags. Presto!
@mollietaylor
mollietaylor / histdens2.R
Created September 23, 2012 03:17
Adding Measures of Central Tendency to Histograms in R
png("beaverhistextra.png")
layout(matrix(c(1:2), 2, 1,
byrow = TRUE))
hist(beaver1$temp, # histogram
col = "peachpuff", # column color
border = "black",
prob = TRUE, # show densities instead of frequencies
xlim = c(36,38.5),
ylim = c(0,3),
xlab = "Temperature",
@ttscoff
ttscoff / searchlink.rb
Last active February 26, 2024 07:05
SearchLink creates Markdown links from automatic searches based on special syntax.