This file contains hidden or 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
<?php | |
ob_start("ob_gzhandler"); | |
function loadImage ($file) { | |
$data = getimagesize($file); | |
die(var_export($data)); | |
switch($data["mime"]){ | |
case "image/jpeg": | |
$im = imagecreatefromjpeg($file); |
This file contains hidden or 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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.1.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
$('ul[data-widget=select]').each(function() { | |
var $select = $('<select>'); | |
$(this).find('li').each(function() { |
This file contains hidden or 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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.1.min.js"></script> | |
<script type="text/javascript" src="jquery.focus.js"></script> | |
<script type="text/javascript"> | |
function showTextarea() { | |
var rawContent = 'a § b'; | |
var rawCursorPosition = rawContent.indexOf('§'); | |
rawContent = rawContent.replace('§', ''); |
This file contains hidden or 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
<?php | |
if(!isset($_GET['stories'])) { | |
die('USAGE : randomLikes.php?stories=<story id,story id...>'); | |
} | |
$stories = explode(',', $_GET['stories']); | |
$alldata = array(); | |
foreach($stories as $story) { |
This file contains hidden or 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/ksh | |
if [ $# -ne 1 ] ;then | |
echo "USAGE: $0 <directoryToScan>" | |
exit 1; | |
fi | |
for file in "$1"/* ;do | |
extension=${file##*.} |
This file contains hidden or 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
<?php | |
/** | |
* Memcache class to manage multiple datas to store later (reduces calls to sql and manage race conditions) | |
*/ | |
abstract class CacheData extends Memcached { | |
const ACTION_SET = 'set'; | |
const ACTION_INCREMENT = 'inc'; |
This file contains hidden or 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 | |
# Warning, for each of these rules, we keep the oldest ones | |
# this is required in order to have some files in the oher category | |
KEEP_DAY=1 # How many to keep for each day (except for the current 24h and more than a week) | |
KEEP_WEEK=0 # How many to keep over a week old | |
for i in {1..6} ; do | |
# Find all files that are older than $i days and younger than ($i+1) days and remove them |
This file contains hidden or 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 | |
# /etc/init.d/minecraft | |
# version 2015-01-20 (YYYY-MM-DD) | |
### BEGIN INIT INFO | |
# Provides: minecraft | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Should-Start: $network | |
# Should-Stop: $network |
This file contains hidden or 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
/** | |
* Construct a circle with links all around it. | |
* @params links Array of links (JSON Objects with params name and link) | |
* @params r Integer Radius of the circle | |
* @params thumSize Integer Max width/height for the thumb | |
* @params fullSize Integer Max width/height for the image in the center | |
* | |
* The first element will be on the left and all others will be in clockwise | |
*/ | |
var linksWheel = function(links, r, thumbSize, fullSize, innerText) { |
This file contains hidden or 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
# Git configs | |
git config --global color.branch auto | |
git config --global color.diff auto | |
git config --global color.interactive auto | |
git config --global color.status auto | |
git config --global color.ui auto | |
# Git basic aliases | |
git config --global alias.r reset | |
git config --global alias.co checkout |
OlderNewer