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
/* | |
Find the number of complete row and col from a number of objects | |
*/ | |
col = Math.sqrt(_nbCards); | |
if (_nbCards % col > 0) | |
{ | |
while (_nbCards % ++col != 0){}; | |
} |
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 | |
function getMime($path) | |
{ | |
$mime = ''; | |
if (function_exists("mime_content_type")) | |
{ | |
return mime_content_type($filename); | |
} | |
else if (function_exists("finfo_open")) | |
{ |
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
package ui.utils | |
{ | |
import flash.display.CapsStyle; | |
import flash.display.LineScaleMode; | |
import flash.display.Shape; | |
import flash.events.Event; | |
import flash.utils.clearInterval; | |
import flash.utils.getTimer; | |
import flash.utils.setInterval; | |
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
package com.lafabrick.utils | |
{ | |
public class Lemme | |
{ | |
public function Lemme() | |
{ | |
super(); | |
} | |
public static function lematize( s : String ) : String |
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
protected function getIndexesOf(word : String, source : String = "") : Vector.<int> | |
{ | |
var results : Vector.<int> = new Vector.<int>(); | |
var startIndex : int = source.indexOf( word, 0 ); | |
while( startIndex != -1 ) | |
{ | |
results.push(startIndex); | |
startIndex = source.indexOf( word, startIndex + word.length ); | |
} |
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
drag = 0; | |
logo.swapDepths(20); | |
MovieClip.prototype.bounceInit = function(id) { | |
this.accel =0.7; | |
this.convert = 1.5; | |
this.xpos = 0; | |
this.toX = this.sx=this._x; | |
this.ypos = 0; | |
this.toY = this.sy=this._y; | |
this.r = 10; |
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
var rows = document.getElementsByClassName('row'); | |
[].forEach.call( rows, function(row, i){ | |
if(i%2) { | |
row.addEventListener("click", function(event) { | |
alert('Je suis la ligne numéro' + i); | |
}); | |
} | |
}); |
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
function capitalize(str) { | |
return str.replace(/^[a-zàáâãäåçèéêëìíîïðòóôõöùúûüýÿñ]/, function(x) { | |
return String.fromCharCode(x.charCodeAt(0) - 32); | |
}); | |
} |
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
function capitalize(str) { | |
return str.substr(0, 1).toUpperCase() + str.substr(1) | |
} | |
function capitalize2(str) { | |
return str.replace(/^[a-zàáâãäåçèéêëìíîïðòóôõöùúûüýÿñ]/, function(x) { | |
return x.toUpperCase(); | |
}); | |
} | |
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
function strip_accent( str ) { | |
var acc = "ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿñ".split('') | |
, min = "aaaaaaceeeeiiiiooooouuuuyaaaaaaceeeeiiiioooooouuuuyyn".split('') | |
, l = acc.length | |
, i = 0; | |
for(; i < l ; i++) { | |
str = str.replace( new RegExp(acc[i], "g"), min[i]); | |
} |
OlderNewer