This file contains hidden or 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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
This file contains hidden or 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
var Example = window.Example || (function() { | |
var self = {}; | |
// This method: | |
self.Update = function() { | |
var self = {}; | |
self.itemcurrency = function() { | |
} |
This file contains hidden or 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 | |
//patikriname ar vartotojas ákelia bylà | |
if ($_FILES['byla']) { | |
//tikriname ar ákelta byla yra iðtiesø paveikslëlis | |
if (exif_imagetype($_FILES['byla']['tmp_name'])) { | |
//jei paveikslëlis toliau tikriname ar tinkamas tipas | |
$pav_attr = getimagesize($_FILES['byla']['tmp_name']); | |
$width = $pav_attr[0]; | |
$height = $pav_attr[1]; | |
$type = $pav_attr['mime']; |
This file contains hidden or 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
// Additional code in node-http-proxy.js | |
var crypto = require('crypto'); | |
var redis = require('redis'); | |
var client = redis.createClient(config.opt.redis_port, 'cloudno.de'); | |
client.auth(config.opt.redis_auth, function(result) { | |
util.log("Redis authenticated."); | |
}) |
This file contains hidden or 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 | |
$code = 'js code'; | |
$replace = array( | |
'#\'([^\n\']*?)/\*([^\n\']*)\'#' => "'\1/'+\'\'+'*\2'", // remove comments from ' strings | |
'#\"([^\n\"]*?)/\*([^\n\"]*)\"#' => '"\1/"+\'\'+"*\2"', // remove comments from " strings | |
'#/\*.*?\*/#s' => "", // strip C style comments | |
'#[\r\n]+#' => "\n", // remove blank lines and \r's | |
'#\n([ \t]*//.*?\n)*#s' => "\n", // strip line comments (whole line only) | |
'#([^\\])//([^\'"\n]*)\n#s' => "\\1\n", |
This file contains hidden or 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
$('html,body').animate({scrollTop: $("#block_"+block).offset().top}, 'slow'); |
This file contains hidden or 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
$('html, body').animate({ scrollTop: 0 }, 'slow'); |
This file contains hidden or 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
var isVisible = false; | |
$(window).scroll(function(){ | |
var shouldBeVisible = $(window).scrollTop()>200; | |
if (shouldBeVisible && !isVisible) { | |
isVisible = true; | |
$('#mybutton').show(); | |
} else if (isVisible && !shouldBeVisible) { | |
isVisible = false; | |
$('#mybutton').hide(); | |
} |
This file contains hidden or 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
SELECT * FROM | |
( | |
select * from `my_table` order by timestamp desc | |
) as my_table_tmp | |
group by catid | |
order by nid desc |
This file contains hidden or 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
RewriteBase / | |
RewriteCond %{HTTP_HOST} !^rankoholic\.com$ [NC] | |
RewriteRule ^(.*)$ http://rankoholic.com/$1 [R=301,L] |
OlderNewer