Skip to content

Instantly share code, notes, and snippets.

View yratof's full-sized avatar
🍊
Eating an orange

Andrew yratof

🍊
Eating an orange
View GitHub Profile
@yratof
yratof / index.html
Created August 8, 2014 14:46
jQuery load on window load. But actually work.
<script type="text/javascript">
// jQuery Closure mode
(function($){
$(window).load(function(){
var resize = function() {
$('.masthead > div').equalise();
};
$(window).resize(resize);
resize();
});
@yratof
yratof / default.htm
Created August 12, 2014 10:45
Quick holding page logo layout
<head>
<style>
*{margin: 0; padding: 0;}
body {
background-image: url('http://www.marvelipsum.com/1440/920/random');
background-size: cover;
background-attachment: fixed;
min-height: 100vh;
}
@yratof
yratof / gist:b85f16f2d787d822b629
Created August 15, 2014 11:11
SVG lines draw when scrolling. Only works with paths at the moment
<script>
jQuery(document).ready( function( $ ){
//On scroll call the draw function
$(window).scroll(function() {
drawLines();
});
//If you have more than one SVG per page this will pick it up
function drawLines(){
@yratof
yratof / gist:7c13851205244a6ef4fd
Created August 22, 2014 10:31
When element is clicked, take .class and .value over to a new div
<script type="text/javascript">
jQuery(document).ready(function($) {
$('tr').each(function() {
var row = this;
function contents(){
// The label
var thing = $('.label', row).text();
// The label, trimmed and lowercased for a class
var stripper = thing.trim().toLowerCase();
@yratof
yratof / SassMeister-input.scss
Created September 19, 2014 15:14
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
$px-only: true;
$pxBase : 16; /* 1 */
@function parseInt($n) {
@yratof
yratof / snap.js
Created September 24, 2014 12:45
Devices with snap
var ipad = Snap("#device");
// This is an iPad
var ipad_outter = ipad.path('M296.7,235H9.3 c-4.6,0-8.3-3.7-8.3-8.3V9.3C1,4.7,4.7,1,9.3,1h287.4c4.6,0,8.3,3.7,8.3,8.3v217.4C305,231.3,301.3,235,296.7,235z'),
ipad_inner = ipad.rect(27.2, 28, 251.7, 180);
// Make the svg just white with black lines.
ipad.attr({
fill: "#fff",
stroke: "#000",
@yratof
yratof / hacks.scss
Created September 25, 2014 09:21
inline-block gap removal
/************************
I N L I N E - B L O C K
~ Gap Removal Technique ~
************************/
.i-b{
// Remove that gap
letter-spacing: -0.31em; /* webkit */
letter-spacing: -0.31rem; /* webkit */
*letter-spacing: normal; /* reset IE < 8 */
@yratof
yratof / sql
Created October 10, 2014 12:56
OMC Customers and their Emails SQL Query
SELECT n.invfname As 'First Name',n.invlname As 'Last Name',n.invcompname As 'Company',n.invtel As 'Tellephone Number',n.invadd1 As 'Address Line 1',n.invadd2 As 'Address Line 2',n.invtown As 'Town',n.invcounty As 'County',n.invpostcode As 'Postcode', e.custID AS 'ID', e.emailAddr AS 'Email Address', e.password AS 'Password'
FROM custaddressbook AS n
LEFT JOIN customers AS e
ON e.custID = n.custid
WHERE emailAddr IS NOT NULL
ORDER BY 'First Name'
@yratof
yratof / typeography.scss
Created October 16, 2014 14:00
Battling FOUT with SCSS and Bourbon.
/*
# Typekit and FOUT.
FOUT means "Flash of Unstyled Text"
and that happens when the site loads before the
javascript can get the fonts needed for the
page to be styled.
Typekit have suggested "how about you hide
everything until they load?" and have provided
@yratof
yratof / fonts.jsx
Created October 24, 2014 13:05
Adobe Extend Toolkit - Photoshop Comp Fonts + Sizes
function run(){
var layerSets = app.activeDocument.layerSets;
dumpLayerSets(layerSets);
$.writeln("Top-level layers:");
dumpLayers(app.activeDocument.layers);
}
function dumpLayerSets(layerSets){