Here's an example of how to embed a Gist on GitHub Pages:
{% gist 5555251 %}
All you need to do is copy and paste the Gist's ID from the URL (here 5555251), and add it to a gist tag surrounded by {% and %}.
| //Allowing CORS (Cross-Origin Resource Sharing) requests from | |
| // grunt server, put this into Gruntfile.js | |
| grunt.initConfig({ | |
| connect: { | |
| livereload: { | |
| options: { | |
| port: 9000, | |
| hostname: 'localhost', | |
| middleware: function (connect) { | |
| return [ |
| #!/bin/bash | |
| # https://gist.github.com/robwierzbowski/5430952/ | |
| # Create and push to a new github repo from the command line. | |
| # Grabs sensible defaults from the containing folder and `.gitconfig`. | |
| # Refinements welcome. | |
| # Gather constant vars | |
| CURRENTDIR=${PWD##*/} | |
| GITHUBUSER=$(git config github.user) |
Here's an example of how to embed a Gist on GitHub Pages:
{% gist 5555251 %}
All you need to do is copy and paste the Gist's ID from the URL (here 5555251), and add it to a gist tag surrounded by {% and %}.
A timeline of the last four years of detecting good old window.localStorage.
October 2009: 5059daa
Problem: When linking to the raw version of a gist, the link changes with each revision.
Solution:
To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/
To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]
| (function () { | |
| var i, elements = document.querySelectorAll('body *'); | |
| for (i = 0; i < elements.length; i++) { | |
| if (getComputedStyle(elements[i]).position === 'fixed') { | |
| elements[i].parentNode.removeChild(elements[i]); | |
| } | |
| } | |
| })(); |
| if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
| var Storage = function (type) { | |
| function createCookie(name, value, days) { | |
| var date, expires; | |
| if (days) { | |
| date = new Date(); | |
| date.setTime(date.getTime()+(days*24*60*60*1000)); | |
| expires = "; expires="+date.toGMTString(); |
| var isStorageAvailable = function (storage) { | |
| if (typeof storage == 'undefined') return false; | |
| try { // hack for safari incognito | |
| storage.setItem("storage", ""); | |
| storage.getItem("storage"); | |
| storage.removeItem("storage"); | |
| return true; | |
| } | |
| catch (err) { | |
| return false; |
I believe in the freedom of information, free as in money, and free as in freedom. That this is a fundamental requirement for empowerment.
I understand that ideas are not copyrightable. I expect that you understand this too. I expect that we can both regard all ideas discussed to be of Public Domain, as they are.
I understand that the implementation of ideas is copyrightable.
| @charset "UTF-8" | |
| @import url(http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono); | |
| /** | |
| * CSS Only Warning Sign | |
| * | |
| * Live preview available at: http://dabblet.com/gist/6937981 | |
| * | |
| * A lot of website use an icon of a warning sign to display next to important | |
| * text. |