Skip to content

Instantly share code, notes, and snippets.

<a href="#" data-dropdown="drop1">English</a> <!-- selected locale -->
<ul id="drop1" class="f-dropdown" data-dropdown-content>
<li><a href="#">Cymraeg</a></li> <!-- available locale -->
<li><a href="#">Klingon</a></li> <!-- available locale -->
<li><a href="#">etc...</a></li> <!-- available locale -->
</ul>
.navigation:before {
content:'';
display: block;
height: 4px; /* whatever height it needs to be */
width: 100%;
background-image: url('../path-to-image.png');
background-repeat: repeat; /* Just repeat both ways so it can be as big as we want */
background-position: top left;
}
@wrightmartin
wrightmartin / gist:4d83e19997b4427f34bc
Created February 3, 2015 11:18
Get featured post url
<div class="case-study__screenshot"
<?php if($latest_case_study->has_post_thumbnail()) {
$thumb_id = get_post_thumbnail_id();
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'medium', true);
$thumb_url = $thumb_url_array[0];
?>
style="background-image: url(<?php $thumb_url ?>);"
<?php } ?>
>
</div>
<div class="sidebar__unit sidebar__list">
<h2>What we did</h2>
<p>User Experience Design, Visual Design, Responsive Design, Front-end Development</p>
</div>
<div class="sidebar__unit sidebar__list">
<h2>Team members</h2>
<p>Steve Day, Mike Thompson, Zarino Zappia</p>
</div>
<div class="sidebar__unit sidebar__list">
<h2>Date</h2>
@wrightmartin
wrightmartin / gist:52edbeae88030c220a5d
Created February 13, 2015 09:35
Vagrant up PopIt
==> default: npm
==> default:
==> default: ERR! Error: 400 Bad Request
==> default: npm
==> default: ERR! at WriteStream.<anonymous> (/usr/lib/node_modules/npm/lib/utils/fetch.js:58:12)
==> default: npm ERR!
==> default: at WriteStream.emit (events.js:117:20)
==> default: npm ERR!
==> default: at evalmachine.<anonymous>:1609:14
==> default: npm ERR! at /usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:102:5
( ! ) Warning: include_once(/data/twfy/www/includes/easyparliament/../../../conf/general): failed to open stream: No such file or directory in /data/twfy/www/includes/easyparliament/init.php on line 39
Call Stack
# Time Memory Function Location
1 0.0084 281672 {main}( ) .../index.php:0
2 0.0246 307072 include_once( '/data/twfy/www/includes/easyparliament/init.php' ) .../index.php:3
( ! ) Warning: include_once(): Failed opening '/data/twfy/www/includes/easyparliament/../../../conf/general' for inclusion (include_path='/data/twfy/vendor/phpunit/php-text-template:/data/twfy/vendor/phpunit/php-timer:/data/twfy/vendor/phpunit/php-file-iterator:/data/twfy/vendor/phpunit/phpunit:/data/twfy/vendor/symfony/yaml:/data/twfy/vendor/phpunit/dbunit:/data/twfy/vendor/symfony/yaml:.:/usr/share/php:/usr/share/pear') in /data/twfy/www/includes/easyparliament/init.php on line 39
Call Stack
# Time Memory Function Location
@wrightmartin
wrightmartin / gist:ca9ed23b32a05f98114d
Created June 10, 2015 14:50
How I test long names now
Daenerys Stormborn of the House Targaryen, the First of Her Name, the Unburnt, Queen of Meereen, Queen of the Andals and the Rhoynar and the First Men, Khaleesi of the Great Grass Sea, Breaker of Chains, and Mother of Dragons.
504 git checkout develop
505 git pull origin develop
506 git status
507 git add app/assets/images/logo.png
508 git add app/assets/images/logo@2.png
509 git commit -m "add retina logo"
510 git status
511 git push origin retrofit-header
512 git fetch
513 git fetch
ActiveRecord::StatementInvalid in GeneralController#frontpage
PG::UndefinedTable: ERROR: relation "track_things" does not exist
LINE 5: WHERE a.attrelid = '"track_things"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"track_things"'::regclass
<div class="profile-pic">
<img src="
{% thumbnail object.primary_image "100x100" crop="center" as sm %}
{{ sm.url }}
{% empty %}
{{STATIC_URL}}images/{{object.css_class}}-210x210.jpg
{% endthumbnail %}
" srcset="
{% thumbnail object.primary_image "210x210" crop="center" as lg %}
{{ lg.url }} 640w,