Skip to content

Instantly share code, notes, and snippets.

View idmontie's full-sized avatar

Ivan Montiel idmontie

View GitHub Profile
@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>
-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;
@idmontie
idmontie / color-swatches.css
Created July 27, 2015 18:37
Few color swatches
#swatches .swatch {
float:left;
width:100px;
height:100px;
}
@idmontie
idmontie / monad-example.js
Created August 30, 2015 16:35
Monad example in JavaScript
var cube = function ( x ) { return [x * x * x, "Cube was called"]; };
var square = function ( x ) { return [x * x, "Square was called"]; };
var compose = function ( f, g ) { return function ( a ) { return f( g( a ) ); }; };
var Debuggable = function ( f ) {
return function ( debugInfo ) {
var x = debugInfo[0],
s = debugInfo[1],
@idmontie
idmontie / color-time.html
Created September 14, 2015 03:32
Color Time
<html>
<head>
<style>
#time {
width: 300px;
height: 40px;
margin: 10px auto;
padding: 30px;
font-family: verdana;