Skip to content

Instantly share code, notes, and snippets.

View roccogalluzzo's full-sized avatar
⛑️

Rocco Galluzzo roccogalluzzo

⛑️
View GitHub Profile
i := 42 // i is an int
ptr : Int*
ptr = i& // ptr is now a pointer to i
ptr@ = 24 // the value of ptr is set to 24
printf("i is now %d\n", i) // hint: i = 24 now.
function empty(obj){
while (obj.getLastChild()) {
obj.removeChild(obj.getLastChild());
}
}
def ascii_sorting(l)
convert = lambda text: int(text) if text.isdigit() else text
ascii_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ]
return sorted(l, key=ascii_key )
def ascii_sorting(l)
convert = lambda text: int(text) if text.isdigit() else text
ascii_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ]
return sorted(l, key=ascii_key )
def aws_request(operation="ItemSearch"):
conf = ConfigParser.ConfigParser()
class AwsProductApi:
"Class for send requests on Amazon Product Advertising API."
def __init__(self, host, access_key, secret_key):
self.host = host
self.access_key = access_key
self.secret_key = secret_key
def _raw_request(self, params):
var Element = {
visible: function() {return (!this.hasClassName('toggle'));},
toggle: function() {if (this.visible()) { this.hide();} else {this.show();}},
hide: function() {this.addClassName('toggle'); return this;},
show: function() { this.removeClassName('toggle'); return this;},
remove: function() { this.getParentNode().removeChild(this);return null;},
empty: function() {while (this.getLastChild()) { this.removeChild(this.getLastChild());}},
bind: function(event, fn){ console.log(event, fn)}
}
function $(element) {
var Element = {
visible: function() {return (!this.hasClassName('toggle'));},
toggle: function() {if (this.visible()) { this.hide();} else {this.show();}},
hide: function() {this.addClassName('toggle'); return this;},
show: function() { this.removeClassName('toggle'); return this;},
remove: function() { this.getParentNode().removeChild(this);return null;},
empty: function() {while (this.getLastChild()) { this.removeChild(this.getLastChild());}}
}
function $(element) {
db = ['pri','secondo','terzo','quarto','quinto','sesto']
for string in db:
string_ascii= ''
s_len = len(string)
if (s_len > 5): string = string[:5]
for char in string: string_ascii+= str(ord(char))
144 Query SET NAMES utf8
144 Init DB wordpress
144 Query SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'
144 Query SELECT option_value FROM wp_options WHERE option_name = 'sidebars_widgets' LIMIT 1
144 Query SELECT option_value FROM wp_options WHERE option_name = 'rewrite_rules' LIMIT 1
144 Query SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 10
144 Query SELECT FOUND_ROWS()
144 Query SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category', 'post_tag') AND tr.object_id IN (4, 1) ORDER BY t.name ASC
144 Query SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (4,1)
144 Query SELECT option_value FROM wp_options WHERE option_name = 'kubrick_header_image' LIMIT 1
from routes import Mapper
class CustomMapper(Mapper):
def match(self, url= None, environ= None):
if not url and not environ:
raise RoutesException('URL or environ must be provided')
if not url: