This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hello | |
puts "hello" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = %w{ uno due tre quattro } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# word_frequency.rb | |
# | |
# simple script that count the number of occurrences of a word in a string | |
# | |
# | |
def word_from_string(string) | |
#scan return an array of substring matching a given pattern | |
string.downcase.scan(/[\w']+/) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# queue.rb | |
# | |
# Using array as queue | |
# | |
# Combine use of push and shift | |
# | |
# =OUTPUT= | |
# | |
# $ ruby1.9.1 queue.rb | |
# ["one", "two", "three"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hello world with Node.js | |
var http = require('http'); | |
http.createServer(function(req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
}).listen(1337, "127.0.0.1"); | |
console.log('Server running at http://127.0.0.1:1337/'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* class implementation for javascript */ | |
var Class = function(parent){ | |
var klass = function(){ | |
// call a function with a given _this_ argument and | |
// an array of arguments | |
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/apply | |
this.init.apply(this, arguments); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* compile_directives.c | |
* | |
* Define a DEBUG macro that put the program in Development environment | |
* | |
* Use: | |
* gcc -Wall -DDEV_ENV compile_directives.c -o compile_directives.out | |
* | |
* Author: giustinob[a t]gmail.com | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$FORMS[document][1]["postsubmit_action"]="../../../modules/$_GET[modulo]/pages/$_GET[modulo]_show.php?id=$_GET[idriferimento]";//un pò sporco |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim color scheme based on http://github.com/jpo/vim-railscasts-theme | |
" | |
" Name: railscasts.vim | |
" Maintainer: Ryan Bates | |
" License: MIT | |
set background=dark | |
hi clear | |
if exists("syntax_on") | |
syntax reset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Zend\Db\Sql\Select; | |
// basic table | |
$select0 = new Select; | |
$select0->from('foo'); | |
// 'SELECT "foo".* FROM "foo"'; | |
OlderNewer