Skip to content

Instantly share code, notes, and snippets.

View jpbyrne's full-sized avatar

Jon Byrne jpbyrne

  • Dublin, Ireland
View GitHub Profile
/* @theme ibm-carbon */
@import "default";
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap");
:root {
position: relative;
background: #161616;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jpbyrne
jpbyrne / .block
Last active March 23, 2017 14:29
bar block
license: mit
@jpbyrne
jpbyrne / .block
Last active March 22, 2017 14:05
fresh block
license: mit
@jpbyrne
jpbyrne / gist:507907140b2d6abc5654
Last active August 29, 2015 14:23
Updating TableView Height Constraint
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var tableViewHeightConstraint: NSLayoutConstraint!
var tableViewCell: UITableViewCell = tableView.cellForRowAtIndexPath(NSIndexPath(forRow: 0, inSection: 0))
var cellHeight: CGFloat = tableViewCell?.frame.height
var dataSource: [AnyObject]?
tableViewHeightConstraint.constant = calculateTableViewHeight(cellHeight, dataSource.count)
@jpbyrne
jpbyrne / gist:cf0e678165863cfd616b
Last active August 29, 2015 14:23
Calculate TableView Height
func calculateTableViewHeight(cellHeight: CGFloat, numberOfRows: Int) -> CGFloat {
var tableViewHeight: CGFloat = 0.0
tableViewHeight = cellHeight * numberOfRows
return tableViewHeight
}
$(document).ready(function() {
var theMP3;
var currentSong = 0;
var tracks = ["1","2","3","4","5"];
var id3s=[];
$jScroller.add("#scroller_container","#scroller","left",2);
$jScroller.cache.init = true; // Turn off default Event
$jScroller.config.refresh = 100;
$( "#progressbar" ).progressbar({
value: 0
var ctx;
var count = 0;
var x;
var y;
var img = new Image();
img.src = "sprite_sheet.png";
img.onload = draw;
function draw() {
requestAnimationFrame(draw);
function init() {
video = document.getElementById('video');
video.volume = 0;
var progressSpan = document.getElementById('progress-span');
var progressSlider = document.getElementById('progress-slider');
progressSlider.max = video.duration;
progressSlider.onchange = function() {
video.currentTime = progressSlider.value;
@jpbyrne
jpbyrne / disableSelection.js
Created November 15, 2012 16:02
This method is used to prevent the selection of HTML page elements.
function disableSelection(target){
if (typeof target.onselectstart!="undefined") // if IE
target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") // if Firefox
target.style.MozUserSelect="none";
else // others
target.onmousedown=function(){return false;
}
}