Skip to content

Instantly share code, notes, and snippets.

View idmontie's full-sized avatar

Ivan Montiel idmontie

View GitHub Profile
@idmontie
idmontie / tyranny-cardgame.markdown
Created January 30, 2015 02:49
Tyranny Card Game Idea

Pass laws to get oppression points.

First to 5 points wins.

Control population's emotions:

  • Fear
  • Anger
  • Lethargy
@idmontie
idmontie / gcd.js
Created February 13, 2015 16:39
Greatest Common Divisor in JavaScript
/*
* Uses the Euvlidean Algorithm.
* http://en.wikipedia.org/wiki/Euclidean_algorithm
*/
function greatestCommonDivisor( a, b ) {
if ( b > a ) {
var t = a;
a = b;
b = t;
}
@idmontie
idmontie / knockoutjs-example.html
Created February 19, 2015 17:53
KnockoutJS Example
<p data-bind="text: name"></p>
<script>
var viewModel = function () {
this.name = 'Ivan';
};
ko.applyBindings( viewModel );
</script>
@idmontie
idmontie / knockoutjs-data-binding-example.html
Created February 19, 2015 18:05
KnockoutJS Two Way Data Binding Example
<input data-bind="value: firstName" placeholder="first name"/>
<input data-bind="value: lastName" placeholder="last name"/>
<p data-bind="text: fullName()"></p>
<script>
var viewModel = function () {
var self = this;
self.firstName = ko.observable( 'Ivan' );
self.lastName = ko.observable( 'M' );
@idmontie
idmontie / php-namespace-example.php
Created February 28, 2015 04:32
php-namespace-example
<?php
namespace My_Namespace;
class My_Class {
public static function my_method () {
return 'wow';
}
}
{{! base-template.handlebars }}
<html>
<head>
<title>{{title}}</title>
</head>
<body>
{{#content}}
</body>
</html>
@idmontie
idmontie / wired-link-underlines.css
Created March 4, 2015 22:18
Wired Style A Tag Underlines
-webkit-appearance: none;
-webkit-background-clip: border-box;
-webkit-background-origin: padding-box;
-webkit-background-size: auto;
-webkit-box-shadow: rgb(218, 150, 34) 0px 5px 0px 0px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-writing-mode: horizontal-tb;
align-items: flex-start;
background-attachment: scroll;
background-clip: border-box;
@idmontie
idmontie / todo-by.js
Created April 24, 2015 16:09
TODO By for JavaScript
// Inspired by https://github.com/andyw8/do_by
// Usage:
// TODO( 'Finish this feature', 'Decemeber 25, 2015' );
// TODO( 'Finish this feature', '12/15/2015' );
this.TODO = function () {
var message = arguments[0];
var date = arguments[1] || false;
// TODO only set the hours to zero if no time is provided in the TODO

Creating custom columns for your website

.row {
  @include clearfix;
}

.column {
  float: left;