Skip to content

Instantly share code, notes, and snippets.

View MightySCollins's full-sized avatar

Sam Collins MightySCollins

View GitHub Profile
@MightySCollins
MightySCollins / zendesk-spam.py
Created November 27, 2018 00:47
Simple script to bulk mark zendesk tickets as spam
import requests
import time
from itertools import islice, chain, repeat
SUBDOMAIN = ""
EMAIL = ""
TOKEN = ""
MIN = 1
@MightySCollins
MightySCollins / .env
Created September 22, 2017 09:27
Django S3 CDN Config
DJANGO_AWS_MEDIA_CDN=cdn.DOMAIN.com
DJANGO_AWS_S3_HOST=s3.eu-west-2.amazonaws.com
DJANGO_AWS_S3_REGION_NAME=eu-west-2
DJANGO_AWS_STORAGE_BUCKET_NAME=BUCKET_NAME
@MightySCollins
MightySCollins / index.php
Created July 21, 2017 21:29
Spinning Hackspace Logo
<html>
<link rel="stylesheet" href="style.css">
<body>
<div id="site">
<img src="logo.svg" id="logo">
<h1 id="title">Maidstone Hackspace</h1>
</div>
</body>
</html>

Email obfuscation

Simple email obfuscation to get around scraping of emails. Falls back to company name if Javascript is not present. Idealy it will be expanded to work wouthout jQuery

Example usage

<span class="email" data-local="info">Cyberbyte Studios</span>
<span class="email" data-local="test" data-domain="bbc.co.uk">BBC Studios</span> 
@MightySCollins
MightySCollins / keybase.md
Last active January 11, 2017 17:10
My Keybase Key

Keybase proof

I hereby claim:

  • I am mightyscollins on github.
  • I am scollins (https://keybase.io/scollins) on keybase.
  • I have a public key ASBTLapdq6hDXAeNd68cM1SUjVRyIrepTgFVn2XjP9IxhQo

To claim this, I am signing this object:

@MightySCollins
MightySCollins / docker.md
Last active June 23, 2016 11:35
Guide for installing Docker

Installing Docker

You will need to install both docker and docker compose.

Prerequisites

This guide assumes your Distro is up to date. If it is not run the commands below

apt-get update
apt-get dist-upgrade

You should also make sure that you are not using the root user but a user with sudo privileges.

@MightySCollins
MightySCollins / functions.php
Last active March 15, 2016 13:29
WordPress Theme active widget
<?php
// Replace WordPress with theme name
// https://gist.github.com/MightySCollins/0504a1fc7b0acaa49121/
function wordpress_add_widgets() {
wp_add_dashboard_widget(
'wordpress_dashboard_widget',
'WordPress Theme',
'show_wordpress_widget'
);
}
@MightySCollins
MightySCollins / functions.php
Last active March 11, 2016 12:30
WordPress Login Custom SCSS
<?php
function theme_login_logo()
{
wp_enqueue_style( 'custom-login', get_template_directory_uri() . '/css/login.css' );
}
add_action('login_enqueue_scripts', 'theme_login_logo');
function theme_login_logo_url()
{
return 'https://wordpress.org/';
@MightySCollins
MightySCollins / csrf.php
Last active June 16, 2016 11:38
PHP Class for quickly securing forms against CSRF attacks
<?php
/**
* PHP Class for quickly securing forms against CSRF attacks
*
* @author Sam Collins
* @copyright 2015 Sam Collins
* @link https://gist.github.com/MightySCollins/0096d193fdc4160565b3
*/
class FormToken
@MightySCollins
MightySCollins / Convert
Created February 13, 2015 22:45
File to convert text into upper and lowercase into regex format
program Convert;
uses
SysUtils;
var
before,convertto:string;
I,len:integer;
output:Text;