Skip to content

Instantly share code, notes, and snippets.

View jankal's full-sized avatar
🌍
Discovering all the wonders.

Alexander Jank jankal

🌍
Discovering all the wonders.
View GitHub Profile
from heapq import heappush, heapify, heappop
#Question1
def table_frequences(texte):
table={}
for i in texte:
if i in table:
table[i]=table[i]+1
@lovasoa
lovasoa / game.html
Last active July 27, 2016 17:57
Unfinished HTML5 game that uses the Gamepad API. The whole game is rendered in an HTML5 <SVG> element.
<!doctype html>
<html>
<head>
<meta charset="utf8">
<title>Turfu</title>
<style>
body{
background-color:black;
}
svg{
@antonmedv
antonmedv / DotNotation.php
Last active August 11, 2022 13:47
Dot notation for access multidimensional arrays.
<?php
/**
* Dot notation for access multidimensional arrays.
*
* $dn = new DotNotation(['bar'=>['baz'=>['foo'=>true]]]);
*
* $value = $dn->get('bar.baz.foo'); // $value == true
*
* $dn->set('bar.baz.foo', false); // ['foo'=>false]
*
@jazzychad
jazzychad / gist:3861848
Created October 9, 2012 22:28
git post-receive hook to tar the repo and send to s3 for backup
#!/bin/bash
# a post-receive hook for git servers to tar the current repo and send to s3 for backup
# save as 'post-receive' and put it in .git/hooks of desired repo(s), chmod +x
# assumes you have the s3cmd program installed and configured (sudo apt-get install s3cmd)
echo "thanks for the push. have a nice day."
# configure your S3BUCKET name, the rest should be automatic
@geeknam
geeknam / git_history.php
Created May 8, 2011 16:43
Parse git log with PHP to an array
<?php
// Author: Ngo Minh Nam
$dir = "/path/to/your/repo/";
$output = array();
chdir($dir);
exec("git log",$output);
$history = array();
foreach($output as $line){
if(strpos($line, 'commit')===0){