This file contains 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
gem 'sinatra', '~> 1.4.7' | |
require 'sinatra' | |
gem 'oauth', '~> 0.5.1' | |
require 'oauth' | |
gem 'tumblr_client', '~> 0.8.5' | |
require 'tumblr_client' | |
# This is an example of how to use OAuth to access the Tumblr API in Sinatra. | |
# Based on dcesteri's Twitter example: | |
# https://github.com/dcestari/sinatra-twitter-oauth-sample |
This file contains 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
#include <FileConstants.au3> | |
; Pause/Break to "turn on" and "turn off". | |
; While turned on, writes one line from the text file defined by $FILENAME and then presses "Enter" every $SLEEPFOR millseconds. | |
; Defaults = Kafka's Metamorphosis, 3 seconds. | |
; | |
; If you have never needed to do this, don't worry about it. Just don't worry about it. | |
Global Const $FILENAME = "metamorphosis.txt" | |
Global Const $SLEEPFOR = 3000 |
This file contains 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
require 'watir-webdriver' | |
require 'webdriver-user-agent' | |
# Works as of: | |
# - watir-webdriver 0.9.1 | |
# - webdriver-user-agent 7.4 | |
# - selenium-webdriver 2.53.0 | |
# - Firefox 46.0.1 | |
# Creates new Firefox profile to bypass Firefox's chronic profile glitches. |
This file contains 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
require 'typhoeus' | |
require 'json' | |
module TungleClient | |
EXAMPLE_API_KEY = 'fuiKNFp9vQFvjLNvx4sUwti4Yb5yGutBN4Xh10LXZhhRKjWlV4' | |
BASE_BLOG_URL = 'https://api.tumblr.com/v2/blog' | |
BASE_TAG_URL = 'https://api.tumblr.com/v2/tagged' | |
# NOTE: ssl_verifypeer is turned off here due to eternal font of Windows |
This file contains 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
gem 'sinatra', '~> 1.4.7' | |
require 'sinatra' | |
gem 'omniauth-tumblr', '~> 1.2' | |
require 'omniauth-tumblr' | |
gem 'tumblr_client', '~> 0.8.5' | |
require 'tumblr_client' | |
require 'yaml' | |
# omniauth-tumblr + tumblr_client + sinatra Example |
This file contains 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
require 'tumblr_client' | |
require 'fileutils' | |
require 'yaml' | |
@client = Tumblr::Client.new({ | |
:consumer_key => "FILL", | |
:consumer_secret => "THESE", | |
:oauth_token => "FIELDS", | |
:oauth_token_secret => "IN" | |
}) |
This file contains 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
require 'oga' | |
# Scrapes an HTML string for image URLs using Oga + regex. | |
class HtmlImageUrlScraper | |
EXTNAMES = ['.jpeg','.jpg','.gif','.png','.bmp','.svg','.tif','.tiff','.ai','.apng','.bpg','.cgm','.dxf','.eps','.flif','.hdp','.hdr','.heic','.heif','.ico','.iff','.jp2','.jpx','.jxr','.lbm','.pbm','.pgm','.pnm','.ppm','.wdp','.webp'] | |
attr_accessor :extnames, :regexes | |
def initialize(extnames: EXTNAMES, regexes: nil) |
This file contains 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
/* | |
<https://stackoverflow.com/questions/40296831/is-it-possible-to-force-a-copy-of-a-protected-google-doc> | |
NOTE - 2021-05-24 | |
----------------- | |
The script below isn't the fastest way to copy-and-paste from a protected | |
Google Doc. Before trying it, I'd suggest following MikoFrosty's advice from | |
the comments: |
This file contains 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
require 'unicode/emoji' | |
require 'gemoji' | |
# Replaces all emoji within a string with ":#{NAME_OF_EMOJI}:" | |
# Ex: "here's a sheep emoji 🐑" | |
# => "here's a sheep emoji :sheep:" | |
def replace_emoji(str) | |
str.scan(Unicode::Emoji::REGEX).each do |emoji| | |
emoji_name = Emoji.find_by_unicode(emoji).name | |
puts "#{emoji} => #{emoji_name}" |
This file contains 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
require 'nokogiri' | |
# (Unless you are the person I am sending this to, you do not need it.) | |
# | |
# Steps to use: | |
# 1. Export a Google Docs file to HTML. | |
# 2. Unzip the HTML file and put the filename below. | |
# 3. Edit css_pass (further down) to correctly convert 'c{SOME NUMBER}'-class elements to <i>, <b>, or <u>. | |
# 4. Run cleanup() |
OlderNewer