This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Mysql{ | |
static private $link = null; | |
static private $info = array( | |
'last_query' => null, | |
'num_rows' => null, | |
'insert_id' => null | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CHECKSUM=$1 | |
FILE=$2 | |
if [[ -z "$CHECKSUM" ]]; then | |
echo "Usage: $0 md5 file" | |
exit 1 | |
elif [[ -z "$FILE" ]]; then | |
echo "Usage: $0 md5 file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/system/sshb0t.service | |
[Unit] | |
Description=Sync ssh keys | |
After=network.target | |
[Service] | |
Type=simple | |
User=mloberg | |
WorkingDirectory=/home/mloberg | |
ExecStart=/usr/local/bin/sshb0t --interval 1h --user mloberg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace App\Security; | |
use DateTimeImmutable; | |
use Generator; | |
use Predis\Client; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PREFIX=wiki | |
FILES=$(find . -type f -iname '*.md' -o -iname '*.markdown') | |
if [[ "$1" == "revert" ]]; then | |
# To Parse back to normal local [[links]] | |
for file in $FILES; do | |
sed -e 's/\[\(.*\)\](\/$PREFIX\/\(.*\))/[[\1]]/g' $file > $file.tmp | |
mv $file.tmp $file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "socket" | |
class IRC | |
def initialize(info) | |
@server = info[:server] | |
@port = info[:port] || 6667 | |
@password = info[:password] | |
@nick = info[:nick] | |
@channel = info[:channel] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
/** | |
* The Analyzer class. | |
*/ | |
class Analyzer { | |
private $fp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
name: [File.Upload, Request.File] | |
description: Ajax file upload with MooTools. | |
license: MIT-style license | |
author: Matthew Loberg | |
requires: [Request] | |
provides: [File.Upload, Request.File] | |
credits: Based off of MooTools-Form-Upload (https://github.com/arian/mootools-form-upload/) by Arian Stolwijk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
# convert and optmize jpg files to png & gif | |
# requires imagemagick (brew install imagemagick) | |
while read -r file; do | |
echo ">> resizing/converting $file" | |
name="${file%.*}" | |
convert "$file" -resize 1600 -quality 85 -strip "${name}.jpg" | |
convert "$file" -quality 85 -strip -colors 256 "${name}.png" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require("postmark.php"); | |
$postmark = new Postmark("your-api-key","from-email","optional-reply-to-address"); | |
if($postmark->to("reciver@example.com")->subject("Email Subject")->plain_message("This is a plain text message.")->send()){ | |
echo "Message sent"; | |
} |
NewerOlder