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
$(document).ready(function () { | |
$(document).on('change','#sel',function(){ | |
$(this).clone().appendTo('#cloneTarget').after('<br>'); | |
$('select:last').focus(); | |
$('#selectedVal').append($(this).val()+"<br>"); | |
}); | |
}); |
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
import sys | |
if len(sys.argv) < 2: | |
print "Usage: python mocking.py <text>" | |
else: | |
text = str(sys.argv[1]).lower() | |
for i in range(len(text)): | |
sys.stdout.write((i%2==0) and text[i].upper() or text[i]) |
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
def genFib(a,b,i): | |
if i == 10: | |
return 0 | |
c = b + a | |
a = b | |
b = c | |
print(c) | |
i = i + 1 | |
genFib(a,b,i) |
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
import time | |
start_time = time.clock() | |
# using Sieve of Eratosthenes algorithm | |
limit = 10000000 | |
# set objects is more faster | |
not_primenums = set() | |
primes = set() | |
print "Generate prime numbers under ", limit |
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
// login function | |
function ajaxLogin(params) | |
{ | |
$.ajax({ | |
url: APIUrl+'/login', | |
type: 'post', | |
dataType: 'json', | |
data: params, | |
success: function(data) { |
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
maxnum = int(raw_input('Enter limit number: ')) | |
sum = ((maxnum+1)*maxnum) / 2 | |
print(sum) |
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
<p>Choose your clock_bg Photo</p> | |
<!-- choose image file, on choose, automatically set to the canvas --> | |
<input type="file" id="imageLoader" name="imageLoader"/> | |
<!-- hide the tool, only show once file is choosen --> | |
<div id="toolArea" style="display: none;"> | |
<p>Click on the image to place a marker<br> The markers on the image will show the coordinates value in decimal, while the table below will show the coordinates in Hex value.</p> | |
<!-- draw image and markers on the canvas here --> | |
<canvas id="Canvas" width="240" height="240"></canvas> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- Tell the browser to be responsive to screen width --> | |
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> | |
<title>Infinite Scroll Test</title> | |
</head> | |
<body> |
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 | |
/* Facebook Page Posts Scrapper API created by Afif Zafri. | |
Fetch/Scrape posts contents of a page without using Facebook API | |
Usage: http://site.com/api.php?username=CODE , where CODE is the page username | |
*/ | |
if(isset($_GET['username'])) | |
{ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Datatables Study Demo</title> | |
<!-- jQuery --> | |
<script | |
src="https://code.jquery.com/jquery-3.1.1.min.js" | |
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" | |
crossorigin="anonymous"></script> |