Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
Person = { | |
instance: function(name, lastname) | |
{ | |
var base = this; | |
base._private = {} | |
base._public = {} | |
base._private.name = name; | |
base._private.lastname = lastname; |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
sudo apt-get install vim tmux git curl
module CarrierWave | |
module MiniMagick | |
def toaster_filter | |
manipulate! do |img| | |
img.modulate '150,80,100' | |
img.gamma 1.1 | |
img.contrast | |
img.contrast | |
img.contrast | |
img.contrast |
var functions = { | |
a1: function (number, max) { return print(number + 1, max); }, | |
aNaN: function (number, max) { return null;} | |
}; | |
function print(number, max){ | |
document.write(number + '<br />'); | |
var left = max - number; | |
var index = left/left; | |
return functions['a' + index.toString()](number, max); | |
} |
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |
// Copyright (c) Sergey Lyubka, 2013. | |
// All rights reserved. | |
// Released under the MIT license. | |
// This program is used to embed arbitrary data into a C binary. It takes | |
// a list of files as an input, and produces a .c data file that contains | |
// contents of all these files as collection of char arrays. | |
// Usage: | |
// 1. Compile this file: | |
// cc -o embed embed.c |
class FortuneTellerMachine | |
WELCOME = "Hola ¿Quiéres saber tu fortuna?" | |
REQUEST = "Fortuna por monedas, yo quiero yo quiero monedas (2): " | |
CHANGE_BACK = "Here is your change" | |
COST = 2 | |
def initialize | |
clear | |
end |
a = File.read './legal.txt' | |
b = a.force_encoding("ISO-8859-1").encode("utf-8", replace: nil).scan(/inicio([\s\S]+?)fin/) | |
c = [] | |
b.each do |r| | |
d = {} | |
d[:fecha] = r.to_s.scan(/Lima, el (.+?),/).join |
I've just gotten back from the awesome mloc.js conference. There was a talk about compiling C# to JavaScript and one of the benefits explained was static types. Someone from the audience asked, who needs types when you do Test Driven Development?
I tried to address the question in my talk on Roy but I talked to some developers afterwards and they thought that TDD