Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mdo's full-sized avatar

Mark Otto mdo

View GitHub Profile
@nrrrdcore
nrrrdcore / list.css
Created August 20, 2012 23:22
Simple Fix for the Webkit Clipped Border-Radius Bug
.list-container {
border-radius: 5px;
border: 1px solid #C5C5C5;
box-shadow: inset 0 1px 0 #FFF;
}
ol {
border: 1px solid transparent;
}
@dannykeane
dannykeane / output.css
Created February 11, 2013 12:12
Less CSS Retina Mixin
#element{
background-image: url('/images/sprite.png');
background-repeat: no-repeat;
background-position: -3px 0;
}
@media print, screen,
(-webkit-min-device-pixel-ratio: 1.25),
(~`"-o-min-device-pixel-ratio: 1.25/1"`),
(min--moz-device-pixel-ratio: 1.25),
@hopsoft
hopsoft / readme2ghpage.rb
Created June 21, 2012 17:09
Convert your README.md on master to index.md on gh-pages
#!/usr/bin/env ruby
# checkout the readme from the master branch
`git checkout gh-pages; git checkout master README.md`
path = `pwd`.gsub(/\n/, "")
readme_path = File.join(path, "README.md")
index_path = File.join(path, "index.md")
# write the index readme file
@max
max / i.sh
Last active April 24, 2019 17:33
#!/usr/bin/env sh
set -e
echo "Fetching fonts from Apple..."
curl -o /tmp/SF-Font.dmg https://developer.apple.com/design/downloads/SF-Font.dmg
hdiutil attach -nobrowse -quiet -noverify -noautoopen -mountpoint /Volumes/SF-Font /tmp/SF-Font.dmg
echo "Installing fonts..."
cp -R /Volumes/SF-Font/. /Library/Fonts/
@font-face {
font-family: 'EntypoRegular';
src: url('font/entypo.eot');
src: url('font/entypo.eot?#iefix') format('embedded-opentype'),
url('font/entypo.woff') format('woff'),
url('font/entypo.ttf') format('truetype'),
url('font/entypo.svg#EntypoRegular') format('svg');
font-weight: normal;
font-style: normal;
}
@nternetinspired
nternetinspired / output-articles-by-collection.liquid
Last active April 25, 2021 02:17
Loop through Jekyll collections and output their content as sections and articles
{% comment %}
Loops though every collection you defined in _config.yml and grabs the pages they contain; outputting title and full text with good basic html semantics.
Use page.excerpt instead of page.content to grab the first paragraph, blog list style. Markdownify is optional, depends how you authored content in your collections; I typically use Markdown.
{% endcomment % }
{% for collection in site.collections %}
{% assign name = collection.label %}
<section>
@nicolashery
nicolashery / environment-variables-jekyll-templates.md
Last active January 22, 2023 15:56
Make environment variables available in Jekyll Liquid templates

Environment variables in Jekyll templates

This is one way to pass some data (API tokens, etc.) to your Jekyll templates without putting it in your _config.yml file (which is likely to be committed in your GitHub repository).

Copy the environment_variables.rb plugin to your _plugins folder, and add any environment variable you wish to have available on the site.config object.

In a Liquid template, that information will be available through the site object. For example, _layouts/default.html could contain:

@addyosmani
addyosmani / package.json
Last active January 18, 2024 21:31
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@jmwhittaker
jmwhittaker / Localhost in VMWare VM
Created March 14, 2011 15:22
Get localhost working in VMWare
Connect to your Mac's localhost from within a VMWare virtual machine.
- Boot up VMware and fire up your VM (i'm using Windows 7)
- Make sure that the VM is using NAT
- Fire up the command prompt in Windows and type "ipconfig". IN the resulting text look for your IPv4 address. It will be something like 192.168.xxx.xxx
- Now go to your browser in your VM and type that ip address into the url bar but change the last set of digits to be 2 (or 1).
- so as an example if your ip was found to be 192.168.213.200 change it to be 192.168.213.2
- Assuming that your localhost is running on your mac you should get your localhost in your VM browser.
- If you need to add a non standard port number on the end like 8090 go ahead and do so.
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2: