Skip to content

Instantly share code, notes, and snippets.

@linyco
linyco / de_morgans_laws.rb
Created January 10, 2017 22:58 — forked from just3ws/de_morgans_laws.rb
De Morgan's laws (in Ruby)
puts "<< De Morgan's laws >>\n\n"
PAIRS = [
[false, true],
[true, false],
[true, true],
[false, false]
]
puts "\"NOT (A AND B)\" is the same as \"(NOT A) OR (NOT B)\""
@linyco
linyco / 0_reuse_code.js
Created September 9, 2016 15:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@linyco
linyco / app.js
Last active September 9, 2016 17:02 — forked from jeffjohnson9046/percent-filter.js
Format percentages in AngularJS
// In app.js or main.js or whatever:
// var myApp = angular.module('askchisne', ['ngSanitize', 'ngAnimate', 'ui.bootstrap', 'ui.bootstrap.tpls']);
// This filter makes the assumption that the input will be in decimal form (i.e. 17% is 0.17).
myApp.filter('percentage', ['$filter', function ($filter) {
return function (input, decimals) {
return $filter('number')(input * 100, decimals) + '%';
};
}]);