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 [email protected]
*
* 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
@jhonasn
jhonasn / convert-keep-notes-to-md.py
Last active May 27, 2025 18:25
A script to convert google keep notes to a bunch markdown files aiming mainly to nextcloud notes
#!/usr/bin/env python3
# from pdb import set_trace as bkp
from sys import argv, exit
from os import listdir, path, mkdir, utime
from json import loads as to_dict
from datetime import datetime as date
if '-h' in argv or '--help' in argv:
print('''
@Mo45
Mo45 / discord.msg.send.php
Last active May 31, 2025 13:34
PHP - Send message to Discord via Webhook
<?php
/**
* discord.msg.send.php v0.8
* Kirill Krasin &copy; 2025
* https://github.com/Mo45
*
* For revisions and comments vist: https://gist.github.com/Mo45/cb0813cb8a6ebcd6524f6a36d4f8862c
*
* Sends a message to Discord via Webhook with file support and rate limit handling
*
@blowsie
blowsie / glyphicon_font-awesome_convert.scss
Last active November 19, 2024 12:39
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))."'");
}