Skip to content

Instantly share code, notes, and snippets.

View willhalling's full-sized avatar

Will Halling willhalling

View GitHub Profile
@willhalling
willhalling / index.php
Created April 18, 2013 20:08
Latest Tweets ordered by date (jQuery)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Latest Tweets Ordered by Date</title>
<meta name="robots" content="noindex, nofollow" />
</head>
<body>
<select id="test">
<option selected="selected" value="dateDesc">Date Descending</option>
@willhalling
willhalling / select-change.html
Created July 19, 2013 09:37
Simple jQuery function to change class of labels when radio buttons are selected.
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<title>Select/Change option</title>
<style type="text/css">
.red {color: red;}
.black {color: black;}
@willhalling
willhalling / read-more-example.html
Created July 19, 2013 09:38
Read/hide text after a certain amount of characters.
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<title>Read More Example (with character count)</title>
<style type="text/css">
a:visited {color:#0254eb}
.ccount {width:400px; background-color:#f0f0f0; margin:10px}
@willhalling
willhalling / placeholder-support.js
Created July 25, 2013 08:20
Placeholder input text support in IE8/9
// placeholder text support in IE8/IE9
$(function() {
if(!$.support.placeholder) {
var active = document.activeElement;
$(':text').focus(function () {
if ($(this).attr('placeholder') != '' && $(this).val() == $(this).attr('placeholder')) {
$(this).val('').removeClass('hasPlaceholder');
}
}).blur(function () {
if ($(this).attr('placeholder') != '' && ($(this).val() == '' || $(this).val() == $(this).attr('placeholder'))) {
@willhalling
willhalling / disabled-enter-key.js
Created July 25, 2013 08:24
Disable enter key on form
$('#formID').keypress(function(event){
// prevent enter key action
if (event.keyCode == 10 || event.keyCode == 13) {
event.preventDefault();
// still want to try and submit form when enter key pressed
this.submit();
}
});
@willhalling
willhalling / identify-first-item.html
Created August 6, 2013 09:53
Identify first item.
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<title>Identify first item</title>
<script type="text/javascript">
$(function() {
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<title>.children() method</title>
<script type="text/javascript">
$(function() {
// declare our Strava Class
class Strava {
// define our constructor method
// pass in the Running Routes object
constructor(application) {
this.CLIENT_ID = application.CLIENT_ID;
this.AUTHORIZATION_ENDPOINT = application.AUTHORIZATION_ENDPOINT;
this.ACCESS_TOKEN = application.ACCESS_TOKEN;
this.ACCESS_TOKEN_AUTHORIZED = null;
}
@willhalling
willhalling / js
Created December 12, 2020 09:44
Editly Example for Gratitude video used at https://www.youtube.com/watch?v=36xT60Pue40
const editly = require('../index');
const { easeOutExpo } = require('../transitions');
const { getPosition } = require('./utils/position');
const NAME = 'nicole-thea';
const PRIMARY_COLOUR = '#FFFFFF';
const SECONDARY_FONT_FAMILY = 'Roboto Light Italic';
const SECONDARY_FONT_URL = 'Roboto-LightItalic.ttf';
@willhalling
willhalling / gist:e76edc84003b68d860f05a0bcf280734
Created March 25, 2021 11:25
Remotion text typewriter effect
import {spring, useCurrentFrame, interpolate, Easing, useVideoConfig} from 'remotion';
/*
Pass params into component like this:
<TitleThree titleText={`But I watch
and learn from them.
I like the little they know,
which is so much.`} titleColor="white" backgroundColor="black" fontSize={60} fontFamily="Lora" />
*/