Skip to content

Instantly share code, notes, and snippets.

<body>
<header>
<h1>My super duper page</h1>
<!-- Header content -->
</header>
<div role="main">
<!-- Page content -->
</div>
<aside role="complementary">
<!-- Secondary content -->
@thaenor
thaenor / gulp_sass_livereload.md
Created December 22, 2016 12:42 — forked from kellishouts/gulp_sass_livereload.md
Gulp + Sass + LiveReload 1.0

Gulp + Sass + LiveReload

This Gist goes over setting up a gulp workflow that will:

  1. watch for any sass changes, then compiles sass source into css
  2. watch for any changes in the public directory, and trigger live-reload
  3. serve static content in public/

@thaenor
thaenor / SassMeister-input.scss
Last active December 22, 2016 12:01
My first grid system
// ----
// Sass (v4.0.0.alpha.1)
// Compass (vundefined)
// ----
$settings: (
maxWidth: 800px,
columns: 12,
margin: 15px,
breakpoints: (
@thaenor
thaenor / Bootstrap.html
Created October 27, 2015 11:19
Creating stacked tabs using Bootstrap (from http://www.bootply.com/74926)
<div class="container">
<div class="row">
<div class="col-md-6">
<h3>Tabs</h3>
<!-- tabs -->
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active"><a href="#one" data-toggle="tab">One</a></li>
<li><a href="#two" data-toggle="tab">Two</a></li>
<li><a href="#twee" data-toggle="tab">Twee</a></li>
var sort_by = function(field, reverse, primer){
var key = primer ?
function(x) {return primer(x[field])} :
function(x) {return x[field]};
reverse = !reverse ? 1 : -1;
return function (a, b) {
return a = key(a), b = key(b), reverse * ((a > b) - (b > a));
//BaseModel.php
protected function dateStringToCarbon($date, $format = 'm/d/Y')
{
if(!$date instanceof Carbon) {
$validDate = false;
try {
$date = Carbon::createFromFormat($format, $date);
$validDate = true;
} catch(Exception $e) { }
@thaenor
thaenor / application.js
Created February 25, 2015 15:43
jQuery example to update a form on focus
/*Content originally from CodeSchool's "try jQuery" lesson. http://try.jquery.com/levels/4/challenges/16 */
$(document).ready(function() {
/*
* this first part fetches the price and multiplies for the number input in the form
*/
$("#nights").on("keyup", function() {
var nights = +$(this).val();
var dailyPrice = +$(this).closest(".tour").data("daily-price");
$("#total").text(nights * dailyPrice);
$("#nights-count").text($(this).val());
@thaenor
thaenor / ex1.pl
Created January 31, 2015 15:34
Grupo 1 - ex1 - Exame ALGAV 3-Fev-2014
dstPosto(pt1,pt2,21).
dstPosto(pt3,pt4,55).
dstPosto(pt5,pt3,30).
dstPosto(pt2,pt5,19).
dstPosto(pt4,pt2,13).
dstPosto(pt1,pt6,28).
abstrobot(r1, [pt4, pt5, pt2, pt6, pt5]).
abstrobot(r2, [pt1, pt3, pt6]).
abstrobot(r3, [pt2, pt5, pt3, pt2, pt6, pt1, pt5]).
@thaenor
thaenor / simple-prolog-examples.pro
Created January 31, 2015 15:33
Some simple Prolog Examples
%originally from http://www.cs.toronto.edu/~sheila/384/w11/simple-prolog-examples.html%
This is obviously not expected to work with a raw copy and paste... obviously
---------------------------
1. Here are some simple clauses.
likes(mary,food).
likes(mary,wine).
likes(john,wine).
likes(john,mary).
@thaenor
thaenor / validation.html
Created January 22, 2015 13:52
Validation example with angular
<!DOCTYPE html>
<html>
<head>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>
<body>
<h2>Validation Example</h2>