Embed your own CSS in the target page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imagesnap ~/Desktop/$(date +%y%m%d%H%M)_camera.png | |
screencapture ~/Desktop/$(date +%y%m%d%H%M)_screen.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# curl https://gist.githubusercontent.com/danvine/5bf13971980126853964/raw > ~/.laptop.local | |
# sh mac 2>&1 | tee ~/laptop.log | |
brew_tap 'caskroom/cask' | |
brew tap 'caskroom/versions' | |
brew_install_or_upgrade 'brew-cask' | |
brew cask install 1password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var API_KEY = "XXX"; | |
var SECRET_KEY = "XXX"; | |
var crypto = require('crypto'); | |
var url2png = function() { | |
this.generateLink = function(url) { | |
var options = "?url="+url + "&viewport=1480x1037&thumbnail_max_width=500"; | |
var token = crypto.createHash('md5').update(options + SECRET_KEY).digest('hex'); | |
return "http://api.url2png.com/v6/"+API_KEY+"/"+token+"/png/"+options; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Be sure to install the apiary gem; https://github.com/apiaryio/apiary-client | |
# gem install apiary | |
# You'll need to get a token here; https://login.apiary.io/tokens | |
APIARY_API_KEY= | |
# Your apiname here; docs.$APINAME.apiary.io | |
APINAME= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Runs a specified shell command in a separate thread. | |
# If it exceeds the given timeout in seconds, kills it. | |
# Returns any output produced by the command (stdout or stderr) as a String. | |
# Uses Kernel.select to wait up to the tick length (in seconds) between | |
# checks on the command's status | |
# | |
# If you've got a cleaner way of doing this, I'd be interested to see it. | |
# If you think you can do it with Ruby's Timeout module, think again. | |
def run_with_timeout(command, timeout, tick) | |
output = '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_secure_s3_url(s3_key) | |
# | |
# s3_key would be a path (including filename) to the file like: "folder/subfolder/filename.jpg" | |
# but it should NOT contain the bucket name or a leading forward-slash | |
# | |
# this was built using these instructions: | |
# http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?S3_QSAuth.html | |
# http://aws.amazon.com/code/199?_encoding=UTF8&jiveRedirect=1 | |
s3_base_url = MyApp::Application::S3_BASE_URL # i.e. https://mybucket.s3.amazonaws.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import hashlib | |
class Url2png(object): | |
def __init__(self, options): | |
self.apikey = 'PXXXX' | |
self.secret = 'SXXXX' | |
self.query_string = urllib.urlencode(options) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# place this file in _plugins/url2png.rb | |
# add this to your _config.yml | |
# url2png: | |
# apikey: <apikey> | |
# secret: <secret> | |
require 'liquid' | |
require 'cgi' unless defined?(CGI) | |
require 'digest' unless defined?(Digest) |
NewerOlder