Skip to content

Instantly share code, notes, and snippets.

View elricco's full-sized avatar
🍍
I’m sweet and fuzzy, like a lollipop on the carpet.

Tim elricco

🍍
I’m sweet and fuzzy, like a lollipop on the carpet.
View GitHub Profile
@gherkins
gherkins / image_xml_sitemap.php
Created October 20, 2012 17:04
Create Google (Image) XML Sitemaps using PHP
header("Content-type: text/xml; charset=utf-8");
//create your XML document, using the namespaces
$urlset = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" /><!--?xml version="1.0" encoding="UTF-8"?-->');
//iterate over your sites pages or whatever you like
foreach (getMyPagesOrWhatEver() as $item):
//add the page URL to the XML urlset
@jareware
jareware / SCSS.md
Last active April 23, 2024 22:13
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@paulirish
paulirish / performance.now()-polyfill.js
Last active August 1, 2023 15:42
performance.now() polyfill (aka perf.now())
// @license http://opensource.org/licenses/MIT
// copyright Paul Irish 2015
// Date.now() is supported everywhere except IE8. For IE8 we use the Date.now polyfill
// github.com/Financial-Times/polyfill-service/blob/master/polyfills/Date.now/polyfill.js
// as Safari 6 doesn't have support for NavigationTiming, we use a Date.now() timestamp for relative values
// if you want values similar to what you'd get with real perf.now, place this towards the head of the page
// but in reality, you're just getting the delta between now() calls, so it's not terribly important where it's placed
@mikedidthis
mikedidthis / gist:5717416
Last active March 26, 2018 17:43
Typography Examples - As I got bored of re-writing this all the time. Credits: http://chrisvalleskey.com/fillerama/
<h1>A New Hope</h1>
<h2>Return of the Jedi</h2>
<h3>Rebel Mission to Ord Mantell</h3>
<h4>Return of the Jedi</h4>
<h5>Knights of the Old Republic</h5>
<h6>Return of the Jedi</h6>
<p>The plans you refer to will soon be back in our hands. All right. Well, take care of yourself, Han. I guess that's what you're best at, ain't it? Alderaan? I'm not going to Alderaan. I've got to go home. It's late, I'm in for it as it is. In my experience, there is no such thing as luck.</p>
<p>No! Alderaan is peaceful. We have no weapons. You can't possibly&hellip; The plans you refer to will soon be back in our hands. I find your lack of faith disturbing.</p>
<ul>
<li>In my experience, there is no such thing as luck.</li>
@gpessia
gpessia / Helvetica Neue stack
Created January 24, 2014 11:28
Helvetica Neue CSS font-family stack. Is there a web-safe Helvetica Neue CSS font-family stack? - See more at: http://rachaelmoore.name/posts/design/css/web-safe-helvetica-font-stack/#sthash.lt6rYYGz.dpuf
/**
* Helvetica Neue Normal (No Stretch)
*/
/* Helvetica Neue Black Font Stack */
.{font-family: "HelveticaNeueBlack", "HelveticaNeue-Black", "Helvetica Neue Black", "HelveticaNeue", "Helvetica Neue", 'TeXGyreHerosBold', "Arial Black", sans-serif; font-weight:800; font-stretch:normal;}
/* Helvetica Neue Heavy Font Stack */
.{font-family: "HelveticaNeueHeavy", "HelveticaNeue-Heavy", "Helvetica Neue Heavy", "HelveticaNeue", "Helvetica Neue", 'TeXGyreHerosBold', "Arial Black", sans-serif; font-weight:700; font-stretch:normal;}
@nathansmith
nathansmith / scroll-offset.js
Last active November 27, 2023 04:51
Check if the user is scrolled to the bottom of the page.
window.onscroll = function() {
var d = document.documentElement;
var offset = d.scrollTop + window.innerHeight;
var height = d.offsetHeight;
console.log('offset = ' + offset);
console.log('height = ' + height);
if (offset >= height) {
console.log('At the bottom');
@natelandau
natelandau / .bash_profile
Last active March 20, 2024 22:19
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@johnnyopao
johnnyopao / confirmEmailValidation.html
Last active March 31, 2024 10:03
Confirm Email Validation
<script>
lp.jQuery(function($) {
var ruleID = 'emailMatch';
//The email field to check against
var firstEmailField = 'email';
//The second confirmation email field
/*
* © 2016 - Julián Acosta
* License: CC BY-SA 4.0 (http://creativecommons.org/licenses/by-sa/4.0/)
*
* Print your own logo in developer tools!
*
* Step 1: Convert your logo to ASCII text here: http://picascii.com (I used color output)
* Note: Is possible that you'll have to resize your photo in order to retain aspect ratio
* Step 2: Remove the <pre></pre> tag that is surrounding the generated code, replace with "[" and "]"
* Step 3: Run the following regexes (*DON'T ALTER THE ORDER*) in order to convert to JSON (Works in PHPStorm and Sublime Text 2):
@gseilheimer
gseilheimer / redaxo rex_var::toArray
Created February 1, 2017 20:55
redaxo rex_var::toArray
Zu den Arrays
Eingabe:
CODE: ALLES AUSWÄHLEN
$value1 = rex_var::toArray('REX_VALUE[1]');
<input type="text" name="VALUE[1][]" value="<?php echo $value1[0]; ?>" />
Ausgabe
CODE: ALLES AUSWÄHLEN