Skip to content

Instantly share code, notes, and snippets.

View DavisDevelopment's full-sized avatar

Ryan Davis DavisDevelopment

  • Davis Development
  • Louisiana, US
View GitHub Profile
@DavisDevelopment
DavisDevelopment / .block
Created February 9, 2019 12:36
LOESS Smoothing
license: gpl-3.0
@DavisDevelopment
DavisDevelopment / .htaccess
Created January 8, 2016 03:30
htaccess file for ALL PHP applications
RewriteEngine On
RewriteRule ^ index.php [L]
/* a joke between myself and a fellow student */
import bible.God;
class Religion {
public static function main():Void {
if ( God.isReal() ) {
self.worship( God );
}
else {
self.insult( God.worshippers );
@DavisDevelopment
DavisDevelopment / Luhn.java
Created October 30, 2015 18:20
Annotated Luhn Algorithm implementation, in Java
public class Luhn {
/**
* validate the given card-number with the luhn mod10 algorithm
*/
public static boolean luhn(String card) {
int total = 0; // sum of all digits
int v; // variable to hold the numeric value of the "current" char
int i = card.length(); // current position in the String
/*
@DavisDevelopment
DavisDevelopment / PromptUse.hx
Created October 28, 2015 10:24
tnative examples in Haxe 3.2
package ;
// https://github.com/DavisDevelopment/tnative/blob/master/src/tannus/io/Prompt.hx
import tannus.io.Prompt;
class PrompUse {
/* Program's main function */
public static function main():Void {
var namePrompt:Prompt = new Prompt("What's your name? ");
namePrompt.getLine( handle_input );
@DavisDevelopment
DavisDevelopment / user_input.py
Last active September 16, 2015 04:02
Super-Simple Python3 "Prompt" class
class Prompt( object ):
# Constructor Function
def __init__(self, msg):
self.message = msg
# Method to get the input as a String
def get_string(self):
return (input(self.message).strip())
@DavisDevelopment
DavisDevelopment / Variables.coffee
Last active August 29, 2015 14:15
JavaScript Tips
###
This file assumes the existence of some function 'request', which takes a URL as it's first argument,
and a callback as it's second.
The callback, when the Request has completed, will be invoked with the HTTP response received from the URL as it's first argument
###
#- The HTML data received from google.com
html_data = [null]
#- Make a request to google.com, and get the response
@DavisDevelopment
DavisDevelopment / HashWrap.hx
Created January 9, 2015 05:38
Collection of Useful Stand-Alone Haxe Abstracts
import js.JQuery;
private typedef Property = {name:String, value:Dynamic};
abstract HashWrap (Dynamic) from Dynamic {
public inline function new(o : Dynamic):Void {
this = o;
}
private var self(get, never):HashWrap;
@DavisDevelopment
DavisDevelopment / variable-gettersetter.js
Created January 8, 2015 09:23
JavaScript Getter/Setter Functions
/*
--
> SUPER SIMPLE example of a GetterSetter function which operates on a normal variable
--
*/
//- The Variable the GetterSetter will be operating on
var name = "Ryan Davis";
/**