Skip to content

Instantly share code, notes, and snippets.

View matharchod's full-sized avatar

Jani Momolu Anderson matharchod

View GitHub Profile
@matharchod
matharchod / SassMeister-input.scss
Created November 13, 2014 04:29
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
.nt-tabs {
margin: 5%;
border: 1px solid;
.nav-tabs>li {
width: 25%;
@matharchod
matharchod / SassMeister-input.scss
Last active August 29, 2015 14:07
Generated by SassMeister.com.
// ----
// Sass (v3.4.6)
// Compass (v1.0.1)
// ----
#languageGate {
color: #fff;
text-align: center;
padding: 10%;
position: relative;
@matharchod
matharchod / gist:6137053
Last active December 20, 2015 13:09
jQuery function to scroll to anchor point on page load (split by hash/pound sign)
//scroll to anchor point on page load
function scrollOnLoad() {
try {
//take HREF and split at anchor
var $_elem = $('#' + $(location).attr('href').split('#')[1]);
//find class of anchor element
var $_others = $('.' + $_elem.attr('class'));
//measure window height and element height
//if the window height is smaller that twice the element height, then use regular offset
<!-- TWO STEPS TO INSTALL BASIC SLIDESHOW:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
@matharchod
matharchod / showDateIn.js
Created January 18, 2012 22:05
A jQuery date script that appends the current date & time to a DOM element
function showDateIn(elem) {
var date = new Date();
var today = date.toLocaleDateString();
var hours = date.getHours();
var minutes = date.getMinutes();
var ampm;
if (minutes < 10) {
minutes = "0" + minutes;
}
@matharchod
matharchod / slideshow.html
Created January 13, 2012 00:08
slideshow
<html>
<head>
<title>Gallery Test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
slides = [
"images/plug2-offline-icon.jpg",
"images/notsign-offline-icon.jpg",
"images/globe-offline-icon.jpg",
@matharchod
matharchod / window_measure.js
Created January 12, 2012 22:10
JSON object that uses jQuery to get width and height of viewport
var measure = {
'num' : 9,
'wHeight' : function(){
var h = $(window).height();
return h;
},
'wWidth' : function(){
var w = $(window).width();
return w;
},
@matharchod
matharchod / vCenter.js
Created January 10, 2012 23:14
A jQuery script for vertical centering
function vcenter(a, b) {
var wHeight = $(window).height();
var fHeight = $(a).height();
var nHeight = (wHeight / 2) - (fHeight);
if (!b || b == "" || b == null) {
var b = a;
}
$(b).css({
'position' : 'relative',
'top' : nHeight
@matharchod
matharchod / jQuery Cookie Reader Script
Created October 21, 2011 19:55
A jQuery script that checks the value of a cookie and creates a new cookie plus appends an additional value with "&" as a delimiter to the cookie value. Dependent on cookie.js plugin.