Skip to content

Instantly share code, notes, and snippets.

@sphinxid
sphinxid / anagram.php
Created December 12, 2016 07:55
Simple anagram checker in PHP
<?php
/*
* 2016/12/12
*
* anagram.php
* Simple anagram checker. (cAsE sEnsiTivE)
*
* Firman Gautama <firman.gautama@gmail.com>
*
@sphinxid
sphinxid / palindrome.c
Last active December 12, 2016 09:24
simple palindrome checker in C
/*
* 2016/12/12
*
* palindrome.c
* Simple palindrome checker for small string. (cAsE sEnsiTivE)
*
* Firman Gautama <firman.gautama@gmail.com>
*
*/
#include <stdio.h>
@sphinxid
sphinxid / concurrent-phantomjs-example.py
Created November 27, 2016 18:04
How to Render a Html Page with Selenium Webdriver + PhantomJS in Python
#
# 20160929 - firman.gautama@gmail.com
#
from selenium import webdriver
import time
import concurrent.futures
import signal
from concurrent.futures import ThreadPoolExecutor
from random import randint
@sphinxid
sphinxid / gist:e8b46899959bc9d3382f
Last active August 29, 2015 14:24
Javascript: Call URL before Exit from Page
window.onbeforeunload = function() {
var URL = '//preview.adskom.net/test12345.js';
var request = null;
if (window.XMLHttpRequest){
request = new XMLHttpRequest();
} else if (window.ActiveXObject) {
request = new ActiveXObject("Microsoft.XMLHTTP");
}