Skip to content

Instantly share code, notes, and snippets.

View FLAK-ZOSO's full-sized avatar
๐Ÿ‡ช๐Ÿ‡ช
studying in Estonia

Mattia Marchese FLAK-ZOSO

๐Ÿ‡ช๐Ÿ‡ช
studying in Estonia
View GitHub Profile
@tonylegrone
tonylegrone / gist:501306
Created July 30, 2010 20:56
jQuery - dynamically wrap words in specific tags
/*
Wrap specified words in the specified tag with jQuery
h1, h2, and h3 are preselected because of the project this was made for.
Separate the words you wish to wrap by the "pipe" symbol.
You should note that this cascades down through all child elements. So you can be as broad or narrow as you want with the selector.
*/
$(document).ready(function(){
var pattern = /\b(of|the|in|and)/gi; // target whole words globally and case insensitive
var replaceWith = '<span>$1</span>'; // wrap in the tag you want
@browny
browny / simple_socket_example.c
Last active April 4, 2025 07:35
simple socket example in C
/* --- Usage --- */
g++ server.c -o server
g++ client.c -o client
./server
./client 127.0.0.1
/* --- server.c --- */
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@mattieb
mattieb / time_del.py
Last active February 28, 2022 22:02
Time various methods of removing a possibly-present item from a dict
#!/usr/bin/python
import time
def new_d():
return {
1: 2, 3: 4, 5: 6, 7: 8, 9: 10,
11: 12, 13: 14, 15: 16, 17: 18, 19: 20
}
@roachhd
roachhd / README.md
Last active April 22, 2025 07:38
Basics of BrainFuck

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

BrainFuck Programming Tutorial by: Katie

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

INTRODUCTION

Development Status :: 1 - Planning
Development Status :: 2 - Pre-Alpha
Development Status :: 3 - Alpha
Development Status :: 4 - Beta
Development Status :: 5 - Production/Stable
Development Status :: 6 - Mature
Development Status :: 7 - Inactive
Environment :: Console
Environment :: Console :: Curses
Environment :: Console :: Framebuffer
@gboeing
gboeing / pypi.md
Last active June 17, 2022 16:11
How to organize and distribution a package on pypi

To distribute a package on pypi

Directory structure

/project/
    /package/
        __init__.py
        module.py
 setup.py
DROP DATABASE IF EXISTS ๐Ÿ“š;
CREATE DATABASE ๐Ÿ“š;
USE ๐Ÿ“š;
CREATE TABLE ๐Ÿ‘ค(
๐Ÿ”‘ INTEGER PRIMARY KEY,
๐Ÿ—ฃ varchar(64), -- name
๐Ÿ—“ DATE -- date of registration
@fnky
fnky / ANSI.md
Last active April 27, 2025 19:05
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@Soheab
Soheab / wait_for in command.md
Last active July 11, 2023 16:56
Examples for a wait_for in ext.commands.

This gist shows how to make the bot wait for a message or reaction after doing a command. This should not be copypasted.

Docs

Check the discord.py docs for a detailed explanation of how it all works internally and which kwargs it takes.

Commands

See here two commands, one waiting for any message in a channel and the other waiting for a reaction with a specific emoji.

Check

@ofhouse
ofhouse / install-java-versions.md
Created October 13, 2020 15:16
Install and manage multiple Java SDK versions on Ubuntu

Install and manage multiple Java versions on Ubuntu

This guide shows per example the installation of the Java SDK versions 8 (LTS, already installed) and 11 (LTS).

1. Check which Java versions are avaialable or already installed

apt --names-only search "openjdk-.*jre$"

> Sorting... Done