Skip to content

Instantly share code, notes, and snippets.

View kane-thornwyrd's full-sized avatar
🏠
Working from home

Jean-cédric T. kane-thornwyrd

🏠
Working from home
  • France
  • 04:48 (UTC +02:00)
View GitHub Profile
@kane-thornwyrd
kane-thornwyrd / get_today_timestamp.php
Created April 13, 2012 12:27
Récupérer le timestamp d'aujourd'hui 1nterval style ! XD
<?php
$current_date = date('Y-m-d');
$split_date_now = explode('-', $current_date);
$current_timestamp = mktime(0, 0, 0, $split_date_now[1], $split_date_now[2],
$split_date_now[0]);
$ tower new myProject
create : myProject/.gitignore
create : myProject/.npmignore
create : myProject/.slugignore
create : myProject/Cakefile
create : myProject/app/client/config/application.coffee
create : myProject/app/client/helpers
create : myProject/app/client/stylesheets/application.styl
create : myProject/app/client/controllers/applicationController.coffee
create : myProject/app/controllers/applicationController.coffee
@kane-thornwyrd
kane-thornwyrd / npm-debug.log
Created April 26, 2012 07:51
Second try after npm cache clean
$ npm install
npm http GET https://registry.npmjs.org/design.io
npm http 200 https://registry.npmjs.org/design.io
npm http GET https://registry.npmjs.org/design.io/-/design.io-0.3.1.tgz
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/seq
npm http GET https://registry.npmjs.org/findit
npm http GET https://registry.npmjs.org/node-uuid
npm http GET https://registry.npmjs.org/underscore.logger
Backbone.sync = (method, model, options = null)->
socket = window.NAMESPACE.socket
@signature = (model)->
sig = {}
sig.endPoint = model.url + (('/' + model.id) if model.id else '')
sig.ctx = model.ctx if model.ctx
sig
@event = (operation, sig)->
if sig.ctx
<?php
$endpoint = new stdClass;
$endpoint->disabled = FALSE;
$endpoint->api_version = 3;
$endpoint->name = 'api';
$endpoint->server = 'rest_server';
$endpoint->path = 'api';
$endpoint->authentication = array(
'services' => 'services',
);
@kane-thornwyrd
kane-thornwyrd / Code.coffee
Created May 18, 2012 11:50
Fond de différentes couleurs "au hasard" en JS
couleurs = [
'ff0000'
'00ff00'
'0000ff'
]
m = Math
couleur_de_fond = couleurs[0]
cur = m.floor m.round m.random() * (couleurs.length - 1)
@kane-thornwyrd
kane-thornwyrd / chunkize.coffee
Created May 24, 2012 08:47
Explode a String into small chunks
chunkize = (string, n = 2)->
string.match RegExp '.{1,'+n+'}','g'
@kane-thornwyrd
kane-thornwyrd / test.php
Created May 25, 2012 08:56
random crap
<?php
$shop = array(
array(
'Title' => 'rose',
'Price' => 1.25 ,
'Number' => 15
),
array(
'Title' => 'daisy',
@kane-thornwyrd
kane-thornwyrd / DemoDead.html
Created May 31, 2012 12:26
A start for maybe a 10k JS Demo
<!DOCTYPE html>
<html>
<head>
<title></title>
<script>
function AudioDataDestination(sR) {
var aO = new Audio(), cWpos = 0, pBs = sR / 2, ta = null, taPos;
aO.mozSetup(1, sR);
setInterval(function() {
var w;
@kane-thornwyrd
kane-thornwyrd / gist:2930977
Created June 14, 2012 15:28
suppression de fichier
<?php
$folder = file_directory_path() . '/' . $cache_folder . '/' . $resource_name;
$dh = @opendir($folder);
$folder .= '/';
$suppressed_file_nb = 0;
$files_suppressed_error_nb = 0;
$suppressed_file_errors = array();
if ($dh) {
while (($file = readdir($dh)) !== false) {
if (filetype($folder . $file) !== 'dir' && $file != '.' && $file != '..' && strlen(trim($file)) > 0) {