Skip to content

Instantly share code, notes, and snippets.

@Cylix
Cylix / ssh_opensuse.sh
Last active October 25, 2016 14:39
Accéder aux traces des exams Epitech
LOCALHOST> ssh ssh.epitech.eu -l login_x # passwd UNIX
# Une fois sur la gate ssh, tout autre commande que "ssh opensuse" peut entrainer un close compte!
GATE-SSH> ssh opensuse # passwd UNIX
OPENSUSE> kinit login_x # passwd UNIX
OPENSUSE> aklog
OPENSUSE> cd /u/all/login_x/epreuve
@Cylix
Cylix / 2048.c
Created April 13, 2014 00:05 — forked from justecorruptio/2048.c
M[16],X=16,W,k;main(){T(system("stty cbreak")
);puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i
,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M
[w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<<
(l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k)
]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d
-1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X]
*i;i--);i?M[i%X]=2<<rand()%2:0;for(W=i=0;i<4;
)s(0,i++);for(i=X,puts("\e[2J\e[H");i--;i%4||
puts(""))printf(M[i]?"%4d|":" |",M[i]);W-2
@Cylix
Cylix / intra_epitech_api_urls.md
Last active November 18, 2023 13:23
Intranet Epitech API URLs

Intra Epitech: API URLs

L'intra d'Epitech (intra.epitech.eu) possède une API assez vaste mais malheureusement non documentée. J'ai regroupé ici un certains nombres d'urls concernant cette API.

Pour chacun des liens ci-dessous, ne pas oublier le paramètre &format=json
Attention à bien requêter le https et non pas le http.
La ressource n'est pas encore complète
@Cylix
Cylix / Dockerfile
Created December 4, 2015 21:36 — forked from konklone/Dockerfile
Dockerfile for installing Ruby 2.0 and RVM
FROM ubuntu
MAINTAINER Eric Mill "eric@konklone.com"
# turn on universe packages
RUN echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > /etc/apt/sources.list
RUN apt-get update
# basics
RUN apt-get install -y nginx openssh-server git-core openssh-client curl
RUN apt-get install -y nano
@Cylix
Cylix / keepalive.sh
Created March 12, 2016 06:20
Turn off-on mac wifi if network is not available. Useful when you have a shitty box...
#!/bin/bash
if /sbin/ping -c 5 -W 1 8.8.8.8
then
: # colon is a null and is required
else
/usr/sbin/networksetup -setairportpower en0 off && /usr/sbin/networksetup -setairportpower en0 on
fi
[user]
email = simon.ninon@gmail.com
name = Simon Ninon
[advice]
statusHints = false
[alias]
br = branch
ci = commit
co = checkout
dc = diff --cached
@Cylix
Cylix / .travis.yml
Created June 5, 2018 06:53 — forked from willprice/.travis.yml
How to set up TravisCI for projects that push back to github
# Ruby is our language as asciidoctor is a ruby gem.
lang: ruby
before_install:
- sudo apt-get install pandoc
- gem install asciidoctor
script:
- make
after_success:
- .travis/push.sh
env:
@Cylix
Cylix / cpp_routes_config.cpp
Created October 19, 2020 04:47
Reflection in C++14 - Routes Configuration in C++
router.add(Route{ HTTP::Method::GET, "/articles" }, &articles_controller::index);
router.add(Route{ HTTP::Method::POST, "/articles" }, &articles_controller::create);
router.add(Route{ HTTP::Method::GET, "/articles/:id" }, &articles_controller::show);
router.add(Route{ HTTP::Method::PUT, "/articles/:id" }, &articles_controller::update);
router.add(Route{ HTTP::Method::DELETE, "/articles/:id" }, &articles_controller::destroy);
@Cylix
Cylix / json_routes_config.json
Created October 19, 2020 04:52
Reflection in C++14 - Routes Configuration in JSON
{
"/articles": [
{ "method": "GET", "to": "articles#index" },
{ "method": "POST", "to": "articles#create" }
],
"/articles/:id": [
{ "method": "GET", "to": "articles#show" },
{ "method": "PUT", "to": "articles#update" },
{ "method": "DELETE", "to": "articles#destroy" }
]
@Cylix
Cylix / reflection_dlopen_dlsym.cpp
Created October 19, 2020 05:06
Reflection in C++14 - dlopen & dlsym
#include <dlfcn.h>
#include <iostream>
extern "C" {
void display_nb(int nb) {
std::cout << nb << std::endl;
}
}