Skip to content

Instantly share code, notes, and snippets.

View mkody's full-sized avatar
🍮
Wha-

Kody mkody

🍮
Wha-
View GitHub Profile
@matoakley
matoakley / gist:1092571
Created July 19, 2011 14:38
MySQL to convert a string into a slug
LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM('My String'), ':', ''), ')', ''), '(', ''), ',', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) AS `post_name`
@sontek
sontek / snowjob.sh
Last active August 9, 2024 13:14
Make your terminal snow
#!/bin/bash
LINES=$(tput lines)
COLUMNS=$(tput cols)
declare -A snowflakes
declare -A lastflakes
clear
@mohd-akram
mohd-akram / minesweeper.py
Last active May 4, 2022 03:49
A command line version of Minesweeper in Python
"""A command line version of Minesweeper"""
import random
import re
import time
from string import ascii_lowercase
def setupgrid(gridsize, start, numberofmines):
emptygrid = [['0' for i in range(gridsize)] for i in range(gridsize)]
@johntyree
johntyree / getBlockLists.sh
Last active June 4, 2024 12:30
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@paulirish
paulirish / bling.js
Last active November 4, 2024 17:48
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;
@austinpray
austinpray / AdventureTime.csv
Last active November 10, 2024 10:41
List of important adventure time episodes
Season Episode Title Reason
1 5 The Enchiridion A good intro to the series, plus introduces the important Enchiridion
1 8 Business Time* First mention of Ooo being post-apocalyptic
1 9 My Two Favorite People Intros the Jake and LR plotline
1 10 Memories of Boom Boom Mountain A look at how Finn was adopted into Jake's Family
1 12 Evicted! Intros Marceline
1 16 Ocean of Fear Introduces Finn's phobia
1 22 Henchman* Establishes Finn and Marceline as friends
1 23 Rainy Day Daydream* good episode to show someone who’s never seen the show before
1 25 His Hero introduces the Lich and Billy
@DracoBlue
DracoBlue / Twitter To Twtxt.md
Last active March 28, 2024 12:44
Poor mans twitter to twtxt converter
@azlux
azlux / py_progress_bar.py
Created June 20, 2016 14:52
Progress bar into the terminal in python3
def progress_bar(iteration, total, barLength=50):
percent = int(round((iteration / total) * 100))
nb_bar_fill = int(round((barLength * percent) / 100))
bar_fill = '#' * nb_bar_fill
bar_empty = ' ' * (barLength - nb_bar_fill)
sys.stdout.write("\r [{0}] {1}%".format(str(bar_fill + bar_empty), percent))
sys.stdout.flush()
def bar_example():
for i in range(20):
@azlux
azlux / Warning_IPTABLES.md
Last active March 7, 2022 11:08
Sécurité avec iptables et l'option RELATED

Problème d'ouvertue de port non désirée sur une configuration IPTABLES

Un problème de contournement des règles iptables fixées par utilisateur peut survenir avec l’utilisation de règles iptables RELATED,ESTABLISH trop générique et le chargement de helper de service non présent ou non utilisé sur la machine (exemple FTP actif, SIP, IRC …).

True fact: Mon server MariaDB s'est fait attaqué comme ça alors que le port dans l'iptable n'était pas ouvert.


Menu

  1. Rappel
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active November 13, 2024 14:50
Hyperlinks in Terminal Emulators