Skip to content

Instantly share code, notes, and snippets.

@keithmorris
keithmorris / TwitterHighlights.snippet.php
Created June 24, 2012 00:35 — forked from philsturgeon/TwitterHighlights.snippet.php
MODX Revolution Output filter to create links from Twitter @name, #tag and URLs
<?php
/**
* TwitterHighlights
* Output filter to create links from Twitter @name, #tag and URLs
*/
$input = preg_replace("#(^|[\n ])([\w]+?://[\w]+[^ \"\n\r\t< ]*)#", "\\1<a href=\"\\2\" rel=\"nofollow\">\\2</a>", $input);
$input = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r< ]*)#", "\\1<a href=\"http://\\2\" rel=\"nofollow\">\\2</a>", $input);
$input = preg_replace("/@(\w+)/", "<a href=\"https://www.twitter.com/\\1\" rel=\"nofollow\">@\\1</a>", $input);
$input = preg_replace("/#(\w+)/", "<a href=\"https://www.twitter.com/search/\\1\" rel=\"nofollow\">#\\1</a>", $input);
@xem
xem / LICENSE.txt
Last active June 16, 2021 00:05 — forked from 140bytes/LICENSE.txt
Challenge: Executing more than 140 JS characters in a tweet!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@LeaVerou
LeaVerou / RAINBOWlog.js
Created March 12, 2014 23:30
AWESOMEify your console.log()ing! Because life is too short to be black & white!!!!!!1111one
(function(){
var log = console.log;
console.log = function(str) {
var css = 'background: linear-gradient(to right, red, yellow, lime, aqua, blue, fuchsia, red); color: white; font-weight: bold;';
var args = Array.prototype.slice.call(arguments);
args[0] = '%c' + args[0];
args.splice(1,0,css);
return log.apply(console, args);
}
@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
@lodi-g
lodi-g / root_blinux_4.md
Last active February 2, 2017 21:30
Comment devenir root sous BLINUX 4.0 El Tigre

Devenir root sous BLINUX 4 El Tigre

Les mots en italique sont précisés plus bas.

  • Au démarrage du PC, une fois devant l'écran du grub, sélectionner l'entrée BLINUX 4.0 El Tigre et appuyer sur e.
  • Trouver la ligne commencant par linuxefi, ajouter a la fin init=/bin/sh.
    • Le clavier est en QWERTY, la touche / se situe sur la touche !.
  • Appuyer sur F10.
  • Une fois arrivé devant un terminal, taper la commande su -.
  • sudo mount -o remount,rw /.
  • passwd.
@lodi-g
lodi-g / dump.h
Last active July 30, 2022 01:58
Dump a variable content regardless of its type. Using the C11 _Generic keyword to emulate PHP's var_dump function.
#pragma once
/*
** Using printf, strlen and isprint
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
/*