Skip to content

Instantly share code, notes, and snippets.

View SteeveDroz's full-sized avatar

Steeve Droz SteeveDroz

  • Le Locle, Switzerland
View GitHub Profile
@SteeveDroz
SteeveDroz / LICENSE
Last active September 23, 2020 14:40
Learn Git Branching levels
MIT License
Copyright (c) 2020 SteeveDroz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@SteeveDroz
SteeveDroz / GM_gist.js
Last active November 29, 2019 10:30
Greasemonkey scripts
// ==UserScript==
// @name GitHub "Gist"
// @namespace https://github.com
// @description Add a "Gist" link in the header menu
// @include https://github.com/*
// @version 1.0.0
// @grant none
// ==/UserScript==
document.getElementsByTagName('header')[0].querySelectorAll('ul')[0].innerHTML += `<li><a class="js-selected-navigation-item HeaderNavlink px-2" href="https://gist.github.com">Gist</a></li>`
@SteeveDroz
SteeveDroz / index.php
Created August 11, 2017 16:32
Lists all the projects in subfolders
<?php
if (isset($_GET['phpinfo']))
{
phpinfo();
exit;
}
function lister_projets()
{
$projets = [];
@SteeveDroz
SteeveDroz / shift.txt
Last active August 11, 2017 16:32
Shift (each line is a level in the minigame "Shift")
5121100Z01322402Z3Z13Z00221313225022100Z10Z00Z00Z00Z00Z00Z00Z13Z13Z13Z13Z81321501125013100Z00ZACZ00Z10Y1100ZC0010Z4013100Z00Z00ZB0ZB0Z00Z10ZC0052Z10Z00ZA010Z10Z10Z10Z10Z10ZB0Z5313200Z3121153Z00ZAB00Z10ZC0010Z10Z00Z00ZB0ZA010Z20Z10Z00Z6012252Z00Z00ZB0Z00Z3133110Z70Z3013100Z6012290Z00Z00Z10Z5Z200ZC0010Z10Z10Z00Z6011260Z00Z00Z10Z00ZACZ00Z10Z02Z10Z00Z00ZC0010Z00Z00ZB0Z00Z10Z00Z10Z00Z5321100Z10Z10Z10122401222212200Z10Z10Z10Z00Z
C0052112C0050112C0052112A020Z50112C0020112C0010ZAB10112A020Z10ZC0020112A010ZA060112A020Z52112C0020112AB10Z10Z10ZA020Z10ZC0020112A010ZA010ZA020Z10ZC002011210ZAB10Z80Z10ZC0020Z10Z00Z201125Z1AB10Z10Z10ZC0020Z10Z00Z20112AAAAC020Z10Z00Z2011210XXXY5211210Z53112C0020112AAAAAA020112C00101121011210112101121011210112101121011210112101121011252ZAAAAAC0090Z
80Z92Z00211AAAAC05Z130112502113321210Z10Z10Z10Z10Z10Z10Z10ZC0052ZAAAAC05Z110ZA010Z6Z1531124021210Z10Z10Z10ZC0010ZA010Z52ZAA005Z110ZC0010ZA010ZC0010Z10Z10Z7Z2C0010ZC0010ZA010ZC0010Z52Z10Z10ZC0010ZC0010ZA010ZC0010Z53ZA050Z10ZC0010ZA053112C0010Z10Z10Z1
@SteeveDroz
SteeveDroz / recovery.txt
Last active June 6, 2017 05:45
GitHub recovery code (crypted, obviously)
40c5d-0104c
4e72d-c2934
02cc0-696e8
bd0d8-afbe0
99f8b-4520b
c6d20-426ef
17a04-963d5
5c884-4655f
a8f76-95f14
52326-6ee77
@SteeveDroz
SteeveDroz / iniReader.php
Created May 9, 2017 11:16
Closure PHP function that reads INI files
<?php
// Function
function readIniFile($fileName) {
return function($section, $key) use($fileName) {
$config = @parse_ini_file($fileName, true) or die('Error: no "' . $fileName . '" file found');
return @$config[$section][$key] ?? die('Error: no "' . $key . '" key found in the "' . $section . '" section of ' . $fileName . '.<br>Please check you have the following in your file:<br><br><code>[<b>' . $section . '</b>]</code><br><code>&nbsp;&nbsp;&nbsp;&nbsp;<b>' . $key . '</b> = <i>some value here</i></code>');
};
};
@SteeveDroz
SteeveDroz / self-css.html
Last active February 16, 2017 12:33
Web page that can edit its own CSS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Self CSS</title>
<style id="invisible">
#invisible {
display: none !important;
}
#edit {
@SteeveDroz
SteeveDroz / ShuffleList.cs
Created November 6, 2015 11:09
This allows to shuffle a C# list.
class ShuffleList<T> : List<T>
{
public void Shuffle()
{
Random random = new Random();
for (int count = Count; count > 0; count--)
{
int i = random.Next(count);
Add(this[i]);
RemoveAt(i);