Skip to content

Instantly share code, notes, and snippets.

View charlespeach's full-sized avatar

Charles Peach charlespeach

View GitHub Profile
@steveh
steveh / crontab.sh
Created July 13, 2017 00:09
PRS price to Influxdb
* * * * * /home/steve/power/price | /home/steve/power/write
@joepie91
joepie91 / vpn.md
Last active November 5, 2024 07:42
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@gene1wood
gene1wood / batch-delete-gmail-emails.js
Last active August 30, 2024 15:55
A Google Apps Script script to bulk delete large amounts of email in Gmail while avoiding the error #793 which Gmail encounters normally
/*
This script, when used with Google Apps Scripts, will delete 400 emails and
can be triggered to run every few minutes without user interaction enabling you
to bulk delete email in Gmail without getting the #793 error from Gmail.
Google returns a maximum of 500 email threads in a single API call.
This script fetches 400 threads in case 500 threads is causing timeouts
Configure the search query in the code below to match the type of emails
you want to delete
@willurd
willurd / web-servers.md
Last active October 30, 2024 13:49
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@joshmcarthur
joshmcarthur / api.rb
Created May 29, 2013 08:42
A one-file adapter for any HTTP basic RESTful API. Uses Faraday for making HTTP requests, and dotenv for keeping your API tokens in a file named '.env'. Simply require this file, and start making requests!
# api.rb
#
# Requirments:
# As a service resource
# I want to be able to make API requests in a consistent manner
# So that results are predicatble and easy to handle.
#
# Synopsis:
# This file sets up a Faraday engine to make HTTP requests with,
# and defines a number of helper methods to make API requests easy.
@ezotrank
ezotrank / gist:3910281
Created October 18, 2012 07:27
Paperclip(ImageMagic) resize, crop and other action sheet cheat
'400x300' # resize, maintain aspect ratio
'400x300!' # force resize, don't maintain aspect ratio
'400x' # resize width, maintain aspect ratio
'x300' # resize height, maintain aspect ratio
'400x300>' # resize only if the image is larger than this
'400x300<' # resize only if the image is smaller than this
'50x50%' # resize width and height to 50%
'400x300^' # resize width, height to minimum 400,300, maintain aspect ratio
'2000@' # resize so max area in pixels is 2000
'400x300#' # resize, crop if necessary to maintain aspect ratio (centre gravity)
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')