Skip to content

Instantly share code, notes, and snippets.

View Moc's full-sized avatar

Tijn Kuyper Moc

View GitHub Profile
@JC5
JC5 / webhook-receiver.php
Created January 15, 2021 19:56
A basic script to receive and validate Firefly III webhook messages
<?php
declare(strict_types=1);
/*
* webhook-receiver.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@Mo45
Mo45 / discord.msg.send.php
Last active May 5, 2024 17:25
PHP - Send message to Discord via Webhook
<?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
@blowsie
blowsie / glyphicon_font-awesome_convert.scss
Last active March 5, 2024 13:27
Map glyphicon icons to font-awesome
$fa-font-path: "~font-awesome/fonts";
@import '~font-awesome/scss/font-awesome';
.glyphicon {
@extend .fa;
&.glyphicon-asterisk {
@extend .fa-asterisk;
}
&.glyphicon-plus {
@extend .fa-plus;
@lonalore
lonalore / meta.md
Created March 10, 2016 09:41
Meta-tag collection

General

  • title (Title) - The text to display in the title bar of a visitor's web browser when they view this page. This meta tag may also be used as the title of the page when a visitor bookmarks or favorites this page.
  • description (Description) - A brief and concise summary of the page's content, preferably 150 characters or less. The description meta tag may be used by search engines to display a snippet about the page in search results.
  • abstract (Abstract) - A brief and concise summary of the page's content, preferably 150 characters or less. The abstract meta tag may be used by search engines for archiving purposes.
  • keywords (Keywords) - A comma-separated list of keywords about the page. This meta tag is not supported by most search engines anymore.

Advanced tags

  • robots - Robots - Options: follow, index, noarchive, nofollow, noimageindex, noindex, noodp, nosnippet, notranslate, noydir
    • follow: Allow search engines to follow links on this page (assumed).
  • **i
@CaMer0n
CaMer0n / e107 prefs cleaner
Last active December 16, 2015 17:41
This should clean-out any corruption that has occurred from the v1.0.3 parser bug.
<?php
require_once("class2.php");
require_once(HEADERF);
global $pref; // just in case.
echo "<h2>Cleaned Prefs</h2>";
$stripsan = array('[sanitised]','[/sanitised]','##xss##');
@mrgcohen
mrgcohen / Readme.md
Last active November 9, 2022 22:17
Twitter Bootstrap Typeahead autocomplete example

Requirements

  • bootstrap with typeahead
  • jquery

Explanation

This will use bootstrap with typeahead to create an autocomplete search.

@nikic
nikic / password_hashing_api.md
Created September 12, 2012 15:04
The new Secure Password Hashing API in PHP 5.5

The new Secure Password Hashing API in PHP 5.5

The [RFC for a new simple to use password hashing API][rfc] has just been accepted for PHP 5.5. As the RFC itself is rather technical and most of the sample codes are something you should not use, I want to give a very quick overview of the new API:

Why do we need a new API?

Everybody knows that you should be hashing their passwords using bcrypt, but still a surprising number of developers uses insecure md5 or sha1 hashes (just look at the recent password leaks). One of the reasons for this is that the crypt() API is ridiculously hard to use and very prone to programming mistakes.

@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@septor
septor / gist:2653044
Created May 10, 2012 13:37
sendpm e107 function
function sendpm($to, $from, $subject, $message){
global $tp;
$spm = new db();
return $spm->db_Insert("private_msg", "0, '".intval($to)."', '".intval($from)."', '".intval(time())."', '0', '".$tp->toDB($subject)."', '".$tp->toDB($message)."', '1', '0', '', '', '".intval(strlen($message))."'");
}
@gudbergur
gudbergur / README.markdown
Created February 19, 2012 23:49
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string