Skip to content

Instantly share code, notes, and snippets.

View Deathnerd's full-sized avatar

Wes Gilleland Deathnerd

  • eLink Design
  • Lexington, KY
View GitHub Profile
<?php
// error_reporting(E_ALL);
/**
* Update the log file
* @param string $message The message to write
* @internal param string $request_date The date of the request
*/
function updateLogFile($message) {
file_put_contents("ekulms_log_file.txt", date("d-m-Y") . " [" . mktime() . "]: $message \n", FILE_APPEND);
@Deathnerd
Deathnerd / beeps
Last active August 29, 2015 14:06
<?
/*
* Apparently x07 is the hex code for beep
*/
function beep($number_of_beeps, $pause_interval = 5){
for($i = 0; $i < $number_of_beeps){
echo "\x07";
sleep($pause_interval);
}
}
__author__ = 'deathnerd'
count = 0.0
for i in range(1, 7):
for j in range(1, 7):
for k in range(1, 7):
if (i+j+k)*10 <= 60:
count += 1
__author__ = 'deathnerd'
combinations = list()
for i in range(1, 7):
for j in range(1, 7):
for k in range(1, 7):
#this appends a list (a type of array) to the combinations list
combinations.append([k, j, i])
number_less_than_or_equal_to_sixty = 0.0
package Homework10;
import java.util.Scanner;
/**
* Created by Deathnerd on 4/20/2014.
*/
class Checks {
public static boolean isNumber(char c) {
void traverse() {
Helper hlp = new Helper(null, head);
final Term curr = hlp.current;
while (curr != null) {
System.out.print(curr.getKey() + " ");
hlp.moveNext();
}
System.out.println();
}
<?php
/**
* Created by PhpStorm.
* User: Deathnerd
* Date: 4/12/14
* Time: 9:16 PM
*/
function get_key_values_from_database($key){
$db = mysqli_connect('localhost', 'root', 'root', 'db');
<?php
/**
* Created by PhpStorm.
* User: Deathnerd
* Date: 4/12/14
* Time: 5:58 PM
*/
if(empty($_GET)){
echo "Get not set";
private void selectionSort(int len) {
if(len==1)
return;
int idx=maxSub(len-1);
int t = A[idx/A.length][idx%A.length];
A[idx/A.length][idx%A.length] = A[(len-1)/A.length][(len-1)%A.length];
A[(len-1)/A.length][(len-1)%A.length] = t;
selectionSort(len-1);
public int maxSub(int m) {
int x = A[0][0];
int index = 0;
for (int i = 1; i <= m; i++) {
if (A[i/A.length][i%A.length] > x) {
x = A[i/A.length][i%A.length];
index = i;
}
}
return index;