Skip to content

Instantly share code, notes, and snippets.

View rs77's full-sized avatar

Ryan rs77

View GitHub Profile
@rs77
rs77 / html5.html
Created March 7, 2012 10:58
HTML5: Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="" />
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
@rs77
rs77 / gist:1992537
Created March 7, 2012 11:02
CSS: Image Replacement
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@rs77
rs77 / layout.jade
Created April 19, 2012 08:02
Jude Layout File with JQuery & Bootstrap
!!!
html
head
title= title
link(rel='stylesheet', href='/bootstrap/css/bootstrap.min.css')
link(rel='stylesheet', href='/bootstrap/css/bootstrap-responsive.min.css')
link(rel='stylesheet', href='/stylesheets/style.css')
script(src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js')
script(src='/bootstrap/js/bootstrap.min.js')
body
@rs77
rs77 / index.jade
Created April 19, 2012 08:04
Jade Index File Showing Bootstrap
extends layout
block content
div.top
form.form-horizontal(method="post", id="loginForm")
label Username
input.span3(id="username", type="text", name="User", placeholder="Enter your username")
label Password
input.span3(id="password", type="password", name="Password")
input.btn(type="submit", value="Log In")
@rs77
rs77 / fraction-div.html
Created April 22, 2012 21:08
Fractions using Divs
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>HTML Fractions - Divs</title>
<style>
div.qtn {
font-size: 14px;
}
div.q {
@rs77
rs77 / fraction-table.html
Created April 22, 2012 21:17
Fractions using Table
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>HTML Fractions - Table</title>
<style>
table {
font-size: 16px;
}
@rs77
rs77 / simple-fraction.html
Created April 22, 2012 21:39
Simple fractions
<sup>x<sup>2</sup> + 3x + 5</sup>&frasl;<sub>2x</sub>
@rs77
rs77 / wp_functions.php
Created October 5, 2012 13:48
Favourite WordPress Functions to Customise WP
/** Load Google fonts (Genesis Studio Press theme) */
add_action( 'wp_enqueue_scripts', 'minimum_load_google_fonts' );
function minimum_load_google_fonts() {
wp_enqueue_style(
'google-fonts',
'http://fonts.googleapis.com/css?family=Lato:300,700',
array(),
PARENT_THEME_VERSION
);
}
@rs77
rs77 / .Rprofile
Created December 12, 2012 00:08
Global RStudio IDE .Rprofile file that enables Pandoc to output HTML with LaTeX images using Google Charts API. The resulting output allows for pasting into learning management systems that have rich-text editors. More details on the workflow here: http://www.webed.com.au/34/my-workflow-for-teaching-mathematics-online/
options(rstudio.markdownToHTML =
function(inputFile, outputFile) {
system(paste("pandoc", shQuote(inputFile), "-s --webtex=http://chart.apis.google.com/chart?cht=tx\\&chf=bg,s,FFFFFF00\\&chl= --self-contained -o", shQuote(outputFile)))
}
)
print("Global (or Local) .Rprofile file has been loaded.") // change to Local if .Rprofile is stored in project
// there needs to be a blank file here
@rs77
rs77 / simple-bg-slider.js
Created December 14, 2012 21:40
A simple background-image slider made with jQuery and Underscore in WordPress (inserted before the closing `</body>` tag). More details here: http://www.webbyworks.com.au/41/a-simple-jquery-background-image-slider
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
// check to see if the page contains this element
if ( $('.my-bg-slider').length > 0 ) {
// insert the URIs of all the images you wish to include in the slider here:
var backgroundImages = [ 'http://www.example.com.au/wp-content/uploads/2012/12/DSC_02461.jpg',
'http://www.example.com.au/wp-content/uploads/2012/11/DSC_0161_1.jpg',
'http://www.example.com.au/wp-content/uploads/2012/12/DSC_0587.jpg',