Skip to content

Instantly share code, notes, and snippets.

View micschk's full-sized avatar

Michael van Schaik micschk

View GitHub Profile
@escopecz
escopecz / commands.php
Last active April 18, 2023 22:43 — forked from alanhartless/cron.php
Script to run Mautic (https://mautic.org) commands from a URL.
<?php
if (!isset($_GET['ILoveMauticReallyIDo'])) {
echo 'The secret phrase is wrong.';
die;
}
$link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$allowedTasks = array(
'cache:clear',
@jonathanstark
jonathanstark / verify-google-recaptcha-with-php
Last active March 8, 2024 18:24
Verify Google reCAPTCHA with PHP
#
# Verify captcha
$post_data = http_build_query(
array(
'secret' => CAPTCHA_SECRET,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
)
);
$opts = array('http' =>
@JingwenTian
JingwenTian / composer.json.md
Created October 4, 2014 12:28
Composer Cheat Sheet for developers ( http://composer.json.jolicode.com/ )

###Composer Cheat Sheet for developers

Composer is the dependency manager for PHP and you are on a one-page-only documentation for this tool. Official documentation is on the official website, this page just brings you the essential.

One line installer

curl -sS https://getcomposer.org/installer | php

composer.phar command line

@booleanbetrayal
booleanbetrayal / Gruntfile.js
Last active November 9, 2023 18:59
Example GruntJS configuration for a replacement to the Sprockets Rails asset pipeline
'use strict';
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// configurable paths
var paths = {
@Rathgore
Rathgore / delete_old_mail.py
Created May 4, 2012 21:00
Simple script to delete old messages in an IMAP mailbox
MAIL_SERVER = ''
USERNAME = ''
PASSWORD = ''
MAILBOX = 'Spam'
MAX_DAYS = 7 # Deletes messages older than a week
import imaplib
import datetime
today = datetime.date.today()