Skip to content

Instantly share code, notes, and snippets.

@clzola
clzola / ajaxFileUpload.js
Last active April 13, 2016 07:54
JavaScript Ajax Upload
function completeHandler(jqXHR, testStatus) {
console.log("Complete Handler");
}
function errorHandler(jqXHR, textStatus, errorThrown) {
console.log(jqXHR, textStatus, errorThrown)
console.log("Error Handler");
}
function successHandler(data, textStatus, jqXHR) {
unsigned char* encrypt(char* data, size_t* len, int key)
{
size_t i = 0;
*len = strlen(data);
unsigned char* encrypted_data = new unsigned char [ *len + 1 ];
for(i = 0; i<*len; i++) {
encrypted_data[i] = ((unsigned char) data[i]) ^ key;
}
@clzola
clzola / query_string_signature.php
Last active August 29, 2015 14:15
PHP QueryString Signature
<?php
/**
* Generates signature for provided query string.
*
* Signature is generated as the md5 of query string
* concatanted with length of query string.
* If signature generator function is passed then signauture will be
* generated using that function.
* Use http_build_query function to build query string.
<?php
include 'medoo.php';
class ActiveModel {
public static $table_columns = array();
public function __construct( $parameters = null ) {
$class_name = get_class($this);
$table_name = strtolower($class_name) . 's';
; Program koji ne radi nista
; C Ekvivalent:
; void main(){}
; Potrebno je samo pravilno izaci iz programa
; sa EXIT_SUCCESS (=0)
; Ovo ce raditi
; Ali nije korektno xD