Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Magicalex

💭
I may be slow to respond.
Block or report user

Report or block Magicalex

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Mo45
Mo45 / discord.msg.send.php
Last active Dec 1, 2019
PHP - Send message to Discord via Webhook
View discord.msg.send.php
<?php
//=======================================================================================================
// Create new webhook in your Discord channel settings and copy&paste URL
//=======================================================================================================
$webhookurl = "YOUR_WEBHOOK_URL";
//=======================================================================================================
// Compose message. You can use Markdown
// Message Formatting -- https://discordapp.com/developers/docs/reference#message-formatting
@tobyzerner
tobyzerner / bootstrap.php
Created Sep 11, 2015
Flarum Custom Layout Extension
View bootstrap.php
<?php
namespace Flarum\CustomLayout;
use Flarum\Support\Extension as BaseExtension;
use Illuminate\Events\Dispatcher;
use Flarum\Events\BuildClientView;
use Flarum\Forum\Actions\ClientAction as ForumClientAction;
class Extension extends BaseExtension
View gpg
# Importer une clé
gpg --import [filename]
# Rechercher une clé depuis serveur distant
gpg --keyserver pgp.mit.edu --search-keys KEYID
# Importer une clé depuis un serveur distant
gpg --keyserver pgp.mit.edu --recv-keys KEYID
# Exporter une clé sur un serveur distant
@GaryRogers
GaryRogers / createPhar.php
Last active Dec 23, 2018
Create a Phar archive for PHP
View createPhar.php
<?php
# Create an executable phar
# Name of our archive.
$phar = new Phar("myscript.phar");
# Have to do buffering to make things executable.
# See http://stackoverflow.com/questions/11082337/how-to-make-an-executable-phar
$phar->startBuffering();
@brad-jones
brad-jones / scgi-server.php
Created Jan 23, 2014
The SCGI protocol is a replacement for the Common Gateway Interface (CGI) protocol. It is a standard for applications to interface with HTTP servers. It is similar to FastCGI but is designed to be easier to implement. This is a PHP Implementation.
View scgi-server.php
<?php
/**
* Class: MyListener
* =============================================================================
* This sets up the underlying socket server.
* Using all this nice new LibEvent code which is now part of PHP.
*/
class MyListener
{
@drublic
drublic / rem-fallback.less
Last active May 29, 2019
Fallback rem-mixin in Sass and LESS
View rem-fallback.less
@main-font-size: 16px;
.x-rem (@property, @value) {
// This is a workaround, inspired by https://github.com/borodean/less-properties
@px-fallback: @value * @main-font-size;
-: ~`(function () { return ';@{property}: @{px-fallback}'; }())`;
-: ~`(function () { return ';@{property}: @{value}rem'; }())`;
}
@ramsey
ramsey / md5.php
Created Nov 3, 2011
MD5 hash lookup script that returns XML
View md5.php
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* MD5 hash lookup script that returns XML
*
* written by Ben Ramsey (ben at benramsey dot com)
* with code by Ilia Alshanetsky (ilia at ilia dot ws)
*
* Copyright (c) 2005, Ilia Alshanetsky
* Copyright (c) 2005, Ben Ramsey
@ArtemGr
ArtemGr / SCGI.java
Last active Sep 24, 2019
Java SCGI connector
View SCGI.java
/*
Copyright (c) 2008 ArtemGr
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
You can’t perform that action at this time.