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
#http://bit.ly/28VdHva | |
########## | |
#VARIABLES | |
########## | |
#numbers | |
a = 3 #float, int, and long | |
#strings | |
b = 'ha ' |
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
<html> | |
<head><title>No Framework JavaScript</title> | |
<style> | |
table { | |
border-collapse: collapse; | |
} | |
table, th, td { | |
border: 1px solid black; | |
} | |
</style> |
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
<html> | |
<head><title>Fuzzy Search</title> | |
<script id="algorithm"> | |
//This algorithm is an original work by Andrew Matte in Toronto, [email protected] | |
//You are completely free to do whatever you want with this algorithm but, | |
//please credit me if the project is open source. Also there is no warranty that is it perfectly suited to your use case. | |
//Written originally in Visual Basic to replace VLOOKUP's fuzzy lookup in Microsoft Excel | |
//in 2014, implemented in MS-SQL, Python, and JS. | |
//Apologies for any similarities to an algorithm you personally might have written independently. | |
var proximity = (wordA, wordB) => { |
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/bash | |
echo "App Release Automator by @rodydavis" | |
action="$1" | |
red=`tput setaf 1` | |
green=`tput setaf 2` | |
reset=`tput sgr0` | |
if [ ${action} = "build" ]; then |
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
#include <stdio.h> | |
#include <string.h> | |
void substring(const char [], char[], int, int); | |
float fuzzy_string(const char* a, const char* b) { | |
int reward = 0; | |
int penalty = 0; | |
int len_a = 0; | |
while (a[len_a] != '\0') len_a++; |
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
use std::env; | |
//"./fuzzy andrew andy" should yield 0.91588783 | |
fn main() { | |
let args: Vec<String> = env::args().collect(); | |
let arg1 = &args[1]; | |
let arg2 = &args[2]; | |
println!("{}", fuzzy(arg1.to_string(), arg2.to_string())); | |
} |
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
//[dependencies] | |
//rusqlite = "0.24.0" | |
use std::env; | |
use rusqlite::{params, Connection}; | |
use std::process; | |
struct Prime { | |
id: i64, | |
} |
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
import json | |
def add_table(name, json, exclude=None): | |
non_array_columns = [key for key in json if not isinstance( | |
json[key], list) and key != exclude] | |
id_column = prompt_for_selection(non_array_columns, name) | |
non_array_columns = [x for x in non_array_columns if x != id_column] | |
array_values = [key for key in json if isinstance( | |
json[key], list) and key != id_column and key != exclude] |
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
"""This class provides a way to access to most up-to-date version of a file without reading the whole file from the harddrive. | |
It does this by first reading when the file was last updated from the filesystem and only reads the whole file if the | |
file has been updated since. This is more useful for large files and works because RAM has faster access than the harddrive.""" | |
from datetime import datetime | |
import os | |
class CachedFile: |
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
def one_way_distance(string_a, string_b) | |
score = 0 | |
against = 0 | |
(0..string_a.size-1).each do |idx| | |
(idx..string_a.size-1).each do |len| | |
if !string_b.index(string_a[idx, len-idx+1], 0).nil? | |
score += (len-idx+1)*2 | |
else | |
against += 1 | |
end |
OlderNewer