Skip to content

Instantly share code, notes, and snippets.

View nicinabox's full-sized avatar

Nic Haynes nicinabox

View GitHub Profile
@nicinabox
nicinabox / hack.sh
Last active December 14, 2015 07:19 — forked from DAddYE/hack.sh
#!/bin/sh
##
# This is a script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Run in interactive mode with:
# $ sh -c "$(curl -sL https://gist.github.com/nicinabox/5049538/raw/dce40fa5a064c3d6a4ae5464b1213bab2ca3035f/hack.sh)"
#
# or run it without prompt questions:
data:text/html, <body style="background: #fdfdfd"> <textarea style="font-size: 1.5em; width: 60%; height: 100%; margin: 5% auto; border: none; outline: none; display: block; background: transparent" autofocus onkeyup="javascript:localStorage['note'] += this.value "/>
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain RH-Firewall-1-INPUT (0 references)
// Augment the api with size
$.fn.superslides.api.size = $("." + $.fn.superslides.options.container_class).children().length;
$(document).on('slides.animated', function(e, current, next, prev) {
var size = $.fn.superslides.api.size;
// Fix for next bug
next = next + 1;
if (current === 0) {
console.log('first slide');
$(document).on('slides.animated', '#slides', function(e, current, next, prev) {
if (current < prev) {
// first
}
if (current > next) {
// last
}
});
class window.Domain extends Backbone.Model
initialize: ->
@on 'error', (model, errors) ->
console.log errors
validate: (attrs) ->
errors = []
domains = _.pluck app.Domains, 'url'
if _.include(domains, attrs.url)
$('#slides').superslides().hover(function() {
$(this).superslides('stop');
}, function() {
$(this).superslides('start');
});
$.fn.showHint = function() {
var $data = this.data('content');
return this.each(function(i) {
$(this).empty().html($data[$(this).val()]);
});
};
{% capture reading_time %}
{{ 150 | divided_by: 150 }}
{% endcapture %}
<span>
Reading time: about {{ reading_time }}
{% if reading_time == 1 %}
minute
{% else %}
@nicinabox
nicinabox / device.js
Created September 14, 2012 16:11
Basic device properties for use when checking screen size or mobile.
/*
Author: Nic Aitch - @nicinabox
Version: 1.1
Description: Basic device properties for use when checking screen size or mobile.
License: MIT
*/
(function(window, document, undefined) {
var device = {};