Skip to content

Instantly share code, notes, and snippets.

View ezy's full-sized avatar

Ezy ezy

  • Earth
View GitHub Profile
@ezy
ezy / gist:3293003
Created August 8, 2012 07:09
Brew list
ack imagemagick little-cms2 python
apple-gcc42 jasper make readline
bazaar jbig2dec mercurial scons
cmake jpeg mysql sphinx
gdbm libgpg-error ossp-uuid sqlite
gettext libksba pidof tbb
ghostscript libtiff pkg-config wget
git little-cms postgresql
@ezy
ezy / gist:3345157
Created August 14, 2012 00:35
Sublime Text Settings
{
"auto_indent": true,
"color_scheme": "Packages/User/Tomorrow-Night.tmTheme",
"draw_indent_guides": true,
"font_face": "Monaco",
"font_size": 15.0,
"ignored_packages":
[
"[]"
],
@ezy
ezy / gist:3746858
Created September 19, 2012 00:09
Conditional JS
<script type="text/javascript">
function removejscssfile(filename, filetype){
var targetelement=(filetype=="js")? "script" : (filetype=="css")? "link" : "none" //determine element type to create nodelist from
var targetattr=(filetype=="js")? "src" : (filetype=="css")? "href" : "none" //determine corresponding attribute to test for
var allsuspects=document.getElementsByTagName(targetelement)
for (var i=allsuspects.length; i>=0; i--){ //search backwards within nodelist for matching elements to remove
if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(filename)!=-1)
allsuspects[i].parentNode.removeChild(allsuspects[i]) //remove element by calling parentNode.removeChild()
}
@ezy
ezy / gist:3758541
Created September 20, 2012 21:44
ipad fix msd
&& navigator.userAgent.match(/ipad/i) == null
@ezy
ezy / gist:6336431
Created August 25, 2013 21:26
Creating a box triangle border with content: "▲"; and the :after property
.answers {
width: 95%;
li {
width: 100%;
height: auto;
position: relative;
p {
text-indent: 0;
padding: 7px 0 7px 50px;
background: none;
@ezy
ezy / gist:6362311
Created August 28, 2013 05:04
JS for conditional fixing of a CSS element in a page
JavaScript
$(document).scroll(function(){
var elem = $('.subnav');
if (!elem.attr('data-top')) {
if (elem.hasClass('navbar-fixed-top'))
return;
var offset = elem.offset()
elem.attr('data-top', offset.top);
}
@ezy
ezy / gist:6372971
Created August 29, 2013 00:17
Using the :before property to create a retina ready alternate colour disc in an unordered list
ul {
padding: 5px 0 10px;
margin: 0;
position: relative;
li {
padding: 0 0 10px 15px;
&:before {
content: "•";
position: absolute;
left: 0px;
@ezy
ezy / gist:6518145
Created September 11, 2013 01:13
Hardcoded share links
<!-- I got these buttons from simplesharebuttons.com -->
<div id="share-buttons">
<!-- Facebook -->
<a href="http://www.facebook.com/sharer.php?u=#" target="_blank"><img src="#" alt="Facebook" /></a>
<!-- Twitter -->
<a href="http://twitter.com/share?url=#&text=Simple Share Buttons" target="_blank"><img src="#" alt="Twitter" /></a>
<!-- Google+ -->
@ezy
ezy / gist:6775782
Created October 1, 2013 09:07
Book note subscribe
<div class="createsend-button" style="height:27px;display:inline-block;" data-listid="r/D9/341/A25/B1E7B34298A8328D">
</div><script type="text/javascript">(function () { var e = document.createElement('script'); e.type = 'text/javascript'; e.async = true; e.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://btn.createsend1.com/js/sb.min.js?v=2'; e.className = 'createsend-script'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s); })();</script>
@ezy
ezy / gist:9334192
Created March 3, 2014 20:39
Drupal render node
<?php
$nid = 21; /* Homepage - Block 2 – Integrated services diagram (Static) */
print drupal_render(node_view(node_load($nid)));
?>