Skip to content

Instantly share code, notes, and snippets.

View gesa's full-sized avatar
🙅‍♀️
nope

Aki gesa

🙅‍♀️
nope
View GitHub Profile
@phaer
phaer / raw_tag.rb
Created June 11, 2011 19:11
Raw tag for jekyll. Keeps liquid from parsing text betweeen {% raw %} and {% endraw %}
module Jekyll
class RawTag < Liquid::Block
def parse(tokens)
@nodelist ||= []
@nodelist.clear
while token = tokens.shift
if token =~ FullToken
if block_delimiter == $1
end_tag
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@dryan
dryan / README.md
Last active December 15, 2015 20:19
Python script for deploying files to S3 with multiple deploy environment support. Moved to http://dryan.github.io/d3ploy.
@dryan
dryan / README.md
Last active September 18, 2017 23:15
Script to create redirects in S3 buckets

s3redirect

Authentication

Your AWS credentials can be set in a number of ways:

  1. In a ".boto" file in your home folder. See Boto's documentation for how to create this file.
  2. In the environment variables "AWS_ACCESS_KEY_ID" and "AWS_SECRET_ACCESS_KEY".
  3. Passed in as arguments. -a or --access-key for the Access Key ID and -s or --access-secret for the Secret Access Key.
#!/bin/bash
#############################
## PROGRAM: invalidate_list.sh
## PURPOSE: Given a url and domain to limit searches to
## this will give you a list of all paths you should invalidate
## USAGE: invalidate_list.sh url domain_to_limit_search_to
## EXAMPLE: ./invalidate_list.sh https://webmaker.org webmaker.org
#############################
@paulirish
paulirish / what-forces-layout.md
Last active November 19, 2024 08:58
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
@veganstraightedge
veganstraightedge / each-vs-map.rb
Last active May 2, 2017 22:41
For when you can't remember the difference between .each and .map, here's a reminder! It's written in Ruby, but the principle is the same in Javascript.
# In Ruby
# Array.each
# Iterate through each a collection unchanged
User.all.each do |user|
puts user.email
puts user.name
puts
end