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 | |
# We'll keep the ID of last sent comic here | |
logFile='./xkcd-last-sent.log' | |
toEmail='[email protected]' | |
function getJsonVal() { | |
python -c "import json,sys;sys.stdout.write(json.dumps(json.load(sys.stdin)['$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
### Keybase proof | |
I hereby claim: | |
* I am keune on github. | |
* I am keune (https://keybase.io/keune) on keybase. | |
* I have a public key ASBLSNiPbmWGkjXTRamuMcYeIsqOHzLb1DM2mIA04DAZzAo | |
To claim this, I am signing this object: |
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
// ==UserScript== | |
// @name IMDB Season Rating | |
// @namespace http://ahmetkun.com/ | |
// @version 0.1 | |
// @description calculate the rating of a tv show's seasons by episode ratings. | |
// @author Ahmet Kun | |
// @match http://www.imdb.com/title/*/eprate* | |
// @grant none | |
// ==/UserScript== |
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
/* | |
* Returns an array, containing integers between min and max, including min and max | |
*/ | |
function range(min, max) { | |
if(typeof min !== 'number' || typeof max !== 'number' || isNaN(min) || isNaN(max)) return []; | |
if(min > max) { | |
var tmp = min; | |
min = max; | |
max = tmp; | |
} |
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
function stringAdd(a, b) { | |
/* | |
* Adds two numbers, in a way you would do with pen and paper | |
* Since the numbers are kept as strings, it can handle really big numbers | |
* Useful when you need to calculate sum of two big integers that are bigger than Number.MAX_SAFE_INTEGER | |
*/ | |
a += '' , b += ''; | |
var res = [], carry = 0, lena = a.length, lenb = b.length; | |
if(lena > lenb) { | |
b = new Array(lena - lenb + 1).join('0') + b; |
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
{"lastUpdateDate":"2014-05-25","data":[{"position":"1","artistTitle":"Bob Dylan","songTitle":"Like a Rolling Stone"},{"position":"2","artistTitle":"The Rolling Stones","songTitle":"(I Can\\'t Get No) Satisfaction"},{"position":"3","artistTitle":"John Lennon","songTitle":"Imagine"},{"position":"4","artistTitle":"Marvin Gaye","songTitle":"What\\'s Going On"},{"position":"5","artistTitle":"Aretha Franklin","songTitle":"Respect"},{"position":"6","artistTitle":"The Beach Boys","songTitle":"Good Vibrations"},{"position":"7","artistTitle":"Chuck Berry","songTitle":"Johnny B. Goode"},{"position":"8","artistTitle":"The Beatles","songTitle":"Hey Jude"},{"position":"9","artistTitle":"Nirvana","songTitle":"Smells Like Teen Spirit"},{"position":"10","artistTitle":"Ray Charles","songTitle":"What\\'d I Say"},{"position":"11","artistTitle":"The Who","songTitle":"My Generation"},{"position":"12","artistTitle":"Sam Cooke","songTitle":"A Change Is Gonna Come"},{"position":"13","artistTitle":"The Beatles","songTitle":"Yesterday" |
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
function tryToGetPalinDrome(str) { | |
// Returns -2 if the given word is already a palindrome | |
// Returns -1 if it is impossible to make a palindrome by removing one letter from the given word | |
// Returns a positive integer that shows the position of the character to remove from the word to make a palindrome | |
if(str === reverse(str)) return -2; // already a palindrome | |
var strlen = str.length; | |
for(var i=0; i<strlen; i++) { | |
var partial = str.substring(0, i) + str.substring(i+1, strlen); | |
var reversed = reverse(partial); | |
if(partial === reversed) { |
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
function findDigit(given) { | |
// log all the numbers in specified scope that contain a given digit | |
for (var i = 100; i >= -100; i--) { | |
var absI = Math.abs(i); | |
var numberOfDigits = Math.floor(Math.log(absI) / Math.log(10)) + 1; | |
var found = false, | |
subtract = 0; | |
while (numberOfDigits > 0) { | |
var x = Math.pow(10, --numberOfDigits); | |
var currentDigit = Math.floor((absI - subtract) / x); |
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
-- Turkce isimler sozlugu twitter : http://twitter.com/tserpico | |
CREATE TABLE `isimler` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`isimler` varchar(255) DEFAULT NULL, | |
`cinsiyet` varchar(255) DEFAULT NULL COMMENT 'erkek : E , kadın : K , uniseks : U', | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB; | |
-- ---------------------------- |