Skip to content

Instantly share code, notes, and snippets.

View gopperman's full-sized avatar

Greg Opperman gopperman

View GitHub Profile
@subfuzion
subfuzion / curl.md
Last active June 29, 2024 16:04
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@natebates
natebates / README.md
Last active November 11, 2016 21:36
CSS Cheeseburger

Received a McDonald's flyer and thought the simple cheeseburger could be easily CSS'd.

Perhaps I'll update it to be bulletproof cross-browser, but for now the cheese drips look best in Chrome.

@paulirish
paulirish / what-forces-layout.md
Last active June 26, 2024 20:47
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@developius
developius / README.md
Last active April 25, 2024 22:15
Setup SSH keys for use with GitHub/GitLab/BitBucket etc

Create a new repository, or reuse an existing one.

Generate a new SSH key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings (https://github.com/settings/keys).

Test SSH key:

@Kartones
Kartones / postgres-cheatsheet.md
Last active June 30, 2024 07:52
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
require 'nokogiri'
require 'open-uri'
# Get a Nokogiri::HTML:Document for the page we're interested in...
doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove'))
# Do funky things with it using Nokogiri::XML::Node methods...
####
@tomeara
tomeara / inline_svg_helper.rb
Last active October 25, 2019 13:01
Inline SVG for Rails
# Put this method in your helper file to render inline SVG
def inline_svg(path)
file = File.open("app/assets/images/#{path}", "rb")
raw file.read
end
@witoff
witoff / litecoin_miner.sh
Created March 17, 2013 03:35
Add a litecoin pool miner as a low priority task to your *nix server
wget https://github.com/downloads/pooler/cpuminer/pooler-cpuminer-2.2.3-linux-x86_64.tar.gz
tar -xvzf pooler-cpuminer-2.2.3-linux-x86_64.tar.gz
# Replace USER, ID & PASS with your creds setup on http://litecoinpool.org/account
echo "nohup nice -n 20 ./minerd --url http://litecoinpool.org:9332/ --userpass USER.ID:PASS" > litecoin.sh
chmod a+x litecoin.sh
./litecoin.sh &
# Find thir process
# ps axl | grep lite
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active June 5, 2024 22:16
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@malarkey
malarkey / Contract Killer 3.md
Last active May 24, 2024 23:38
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………