Skip to content

Instantly share code, notes, and snippets.

@scuba323
scuba323 / Python IRC Bot
Created August 5, 2017 14:56
Basic python irc bot that responds to irc server pings, can op/deop, voice/devoice, ban/unban, change topic, send notices, etc.
#!/usr/bin/env python
# victorvortex.py - A simple Python IRC bot
# Authors: mrtux and OldCoder
# License: CC BY-NC-SA 3.0
# Revision: see git rev.
#---------------------------------------------------------------------
# Suggestions.
# These are just suggestions:
@scuba323
scuba323 / README-Template.md
Created August 12, 2017 02:25 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@scuba323
scuba323 / bash-ps1.txt
Created November 16, 2017 04:56 — forked from gregdeane/bash-ps1.txt
Customize BASH PS1 prompt to show current GIT repository and branch
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
__git_ps1 ()
{
local b="$(git symbolic-ref HEAD 2>/dev/null)";

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
<?php
/*
JSON-to-HTML Table
Version 1.0
October 21, 2017
Will Bontrager Software LLC
https://www.willmaster.com/
Copyright 2017 Will Bontrager Software LLC
if (count($data->stand)) {
// Open the table
echo "<table>";
// Cycle through the array
foreach ($data->stand as $idx => $stand) {
// Output a row
echo "<tr>";
echo "<td>$stand->afko</td>";
<?php
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$uploadOk = 1;
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
// Check if image file is a actual image or fake image
if(isset($_POST["submit"])) {
$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
if($check !== false) {
echo "File is an image - " . $check["mime"] . ".";
<!DOCTYPE html>
<html>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>
1
2
3
4
5
6
7
8
9
<?php
function auth($username, $password, $domain = 'RABOTA', $endpoint = 'ldap://rabota.local', $dc = 'dc=rabota,dc=local') {
$ldap = @ldap_connect($endpoint);
if(!$ldap) return false;
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
$bind = @ldap_bind($ldap, "$domain\\$username", $password);
if(!$bind) return false;