Skip to content

Instantly share code, notes, and snippets.

View relipse's full-sized avatar

James Kinsman relipse

View GitHub Profile
@relipse
relipse / DAO.php
Last active January 20, 2022 13:15
Data Access Object
<?php
namespace Todo;
// Data Access Object
abstract class DAO{
protected array $row = [];
public const KEYS = [];
protected static string $table = '';
public static function SetTable(string $table){
/**
* LCRscrollingText jquery plugin
* @description Left Center Right, with center vertical scrolling text using a ul
* @author Jim Kinsman | Paul Kulp | InterVarsity Christian Fellowship (intervarsity.org)
* @version 1.1.0
* @example
* JAVASCRIPT:
* With html already defined:
*
* $('#scrolling_text_container').LCRscrollingText();
/**
*
* Color picker
* Author: Stefan Petre www.eyecon.ro
*
* Dual licensed under the MIT and GPL licenses
*
*/
(function ($) {
var ColorPicker = function () {
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ThrowWindows by Matthäus Drobiec (foom)
; Based on EasyGlide by Paul Pliska (ManaUser) Enhancements by Laszlo
; Based on Easy Window Dragging by Chris?
;
; AutoHotkey Version: 1.0.46+
; Platform: XP/2k/NT
; Author: Matthäus Drobiec (foom)
; Version: 0.1
;
@relipse
relipse / .screenrc
Created February 27, 2014 15:57
.screenrc
#
# my commented .screenrc
#
### screen as an answering machine!
#
# no annoying audible bell, please
vbell on
vbell_msg "Hey - something's ringing on %t (%n)"
activity "Hey - something's moving in %t(%n)"
<?php
/**
* This file will iterate through all your tables and TRIM each field.
* (That means NO trailing or leading spaces)
* Ideally it would be used if there were thousands of rows and columns
* trailing or leading spaces that need to get rid of.
* Oh, and always backup your entire database first.
*/
$link = mysqli_connect(...);
@relipse
relipse / postbitbucketissuetracker
Created February 14, 2014 14:57
POST NEW ISSUE TO BITBUCKET ISSUE TRACKER
curl -r PUT --user <username>:<password> -F "title=This is a test" -F "content=This is also a test." https://bitbucket.org/api/1.0/repositories/<repository owner's username>/<repository name>/issues
@relipse
relipse / irccloud_quickswitcher.js
Last active January 3, 2016 16:39
Easier irccloud channel switching
/**
* The purpose of this script is to allow quick traversing between channels using the keyboard
* For Example, after injecting this script, go to any channel text box and type:
* //<server>#<channel> <optional-text>
* or as below:
* //freenode#javascript hey i have a js question
* It will auto-switch to freenode's #javascript channel and enter that in the text box
* Copyright (C) relipse
* License: Use it however, just don't sell it or say it was you who coded it (Rev 21:8)
*/
@relipse
relipse / upsert.php
Last active December 28, 2015 13:09
Upsert generator, (pdo style)
<?php
//This snippet is released to the public domain of course
/**
* Upsert one column value
*/
function upsert($pkcolname, $pk, $table, $column, $val) {
$sql_upsert_templ = 'INSERT INTO `{TABLE}` (`{PKCOLUMN}`, `{COLUMN}`) VALUES (:pk, :value)
ON DUPLICATE KEY UPDATE `{COLUMN}` = :value_dup';
@relipse
relipse / undo
Created October 18, 2013 00:33
The goal of this script [right now] is to tell you how to "undo" a command. for example undo cd path/to/somewhere would result in "cd -" which will go back to the previous directory, and for example if you do mv path/to/a path/to/b this would produce "mv path/to/b path/to/a"
#!/usr/bin/php
<?php
if (!isset($argv[1])){
die('Usage: undo <command-to-try-and-undo>'."\n");
}
$OLDPWD = `echo "\$OLDPWD"`;
$allargs = $argv;
array_shift($allargs);