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
// XORCipher - Super simple encryption using XOR and Base64 | |
// | |
// Depends on [Underscore](http://underscorejs.org/). | |
// | |
// As a warning, this is **not** a secure encryption algorythm. It uses a very | |
// simplistic keystore and will be easy to crack. | |
// | |
// The Base64 algorythm is a modification of the one used in phpjs.org | |
// * http://phpjs.org/functions/base64_encode/ | |
// * http://phpjs.org/functions/base64_decode/ |
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
#!/bin/bash | |
# A simple shell script that organizes media files in date folders. | |
# This script uses exiftool that can be installed using "sudo apt-get install libimage-exiftool-perl" | |
for file in *.{jpg,JPG,3gp,3GP,png,PNG,mp4,MP4,mov,MOV}; | |
do | |
datepath="$(exiftool -s -G "$file" | grep '\[EXIF\].*ModifyDate' | awk '{print $4 }' | sed s%:%/%g)" | |
if [ -z $datepath ]; then |
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
#!/bin/bash | |
# | |
# Branch Merge script | |
# | |
function usage(){ | |
if [ "$#" -lt 2 ]; then | |
echo "Usage: $0 <Repository Url> <Branch Name>" | |
exit 1 |
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
#!/bin/sh | |
# Ad-hoc shell script generator | |
# Kamran ([email protected]) | |
# Generates script (default=doit) for the executed commands | |
# After generation, commands can be re-run using the doit script | |
echo "Ad-hoc shell script genertor started" |
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
/* | |
* JQuery REST Client | |
* Author: Kamran | |
* Email: [email protected] | |
* | |
* Copyright (C) 2013 Kamran | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and | |
* associated documentation files (the "Software"), to deal in the Software without restriction, | |
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, |
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
var toast=function(msg){ | |
$("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h3>"+msg+"</h3></div>") | |
.css({ display: "block", | |
opacity: 0.90, | |
position: "fixed", | |
padding: "7px", | |
"text-align": "center", | |
width: "270px", | |
left: ($(window).width() - 284)/2, | |
top: $(window).height()/2 }) |
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
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.concurrent.DelayQueue; | |
import java.util.concurrent.Delayed; | |
import java.util.concurrent.TimeUnit; | |
/** | |
* A simple throttled blocking-queue that returns elements at a constant rate (M | |
* elements in N time) | |
* |
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
/* | |
* Doughnut shop | |
* A simple Producer-Consumer relationship with POSIX Threads | |
* author: Kamran | |
* */ | |
#include<stdio.h> | |
#include<stdlib.h> | |
#include<unistd.h> |