Skip to content

Instantly share code, notes, and snippets.

View clement006's full-sized avatar

Clément Noterdaem clement006

View GitHub Profile
<?php
// Zeuxis Lo
// Created at 2011-03-23 05:05 PM
date_default_timezone_set("Asia/Hong_Kong");
function calculate_rank_sum($score, $created_at) {
$order = log10(max(abs($score), 1));
if ($score > 0) {
@clement006
clement006 / index.html
Created November 25, 2013 16:11
A Pen by Clément Noterdaem.
<html>
<html>
<head>
<title>jQuery Opening Hours</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
</head>
<body>
<div class="range-head">
<div class="range-values">
@clement006
clement006 / SCSS-Progress-Circle.markdown
Created November 19, 2013 16:11
A Pen by Clément Noterdaem.
@clement006
clement006 / timthumb.php
Created October 8, 2013 19:42
TimThumb version 2.8.13
<?php
/**
* TimThumb by Ben Gillbanks and Mark Maunder
* Based on work done by Tim McDaniels and Darren Hoyt
* http://code.google.com/p/timthumb/
*
* GNU General Public License, version 2
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* Examples and documentation available on the project homepage
@clement006
clement006 / get_last_part.function.js
Last active December 25, 2015 00:09
Get last part of a typical URL string (lowercase string separated by "-")
function get_last_part(string) {
return string.indexOf("-")<0?"":string.slice(string.lastIndexOf("-")+1);
}
<?php
/**
* Formats string, removes accents from string
* @param string $string String to format
* @return string
*/
function strip_accent($string)
{
$accents = '/&([A-Za-z]{1,2})(grave|acute|circ|cedil|uml|lig);/';
@clement006
clement006 / Pure-CSS3-Mister-Jekyll-Logo.markdown
Created October 8, 2013 14:36
A Pen by Clément Noterdaem.