Skip to content

Instantly share code, notes, and snippets.

View ChrisMoney's full-sized avatar

Chris Weathers ChrisMoney

  • Onevested
  • St. Louis, MO
View GitHub Profile
@ChrisMoney
ChrisMoney / update_antivirus.bat
Created February 15, 2012 15:31
Batch/DOS --Update Anitvirus
//Update Anti Virus
Home users just want to update their antivirus. Business users
are usually admins who want to grab the latest update so they can
redistribute it within their company. And they want to know when
a new update is available so they can trigger some other
notification or distribution program. The problem is that the name
of the update changes, so that makes it harder to code for something
when you don't know the name in advance!
@ChrisMoney
ChrisMoney / url_to_hyperlink.php
Created February 15, 2012 15:32
PHP - convert url to hyperlink
@ChrisMoney
ChrisMoney / api_examples.php
Created February 15, 2012 15:34
API - Examples
API Code:
<?php
//Modify these
$API_KEY = 'your-token-here';
$SECRET = 'your-secret-here';
$TOKEN = 'your-secret-here';
$STORE_URL = 'yourestore.myshopify.com';
$PRODUCT_ID = 'product-id-here';
$url = 'https://' . $API_KEY . ':' . md5($SECRET . $TOKEN) . '@' . $STORE_URL . '/admin/products/' . $PRODUCT_ID . '.xml';
@ChrisMoney
ChrisMoney / coin_toss.py
Created February 15, 2012 15:38
Python --Coin Toss Program
//Coin Toss Program
import random
headcount = tailcount = 0
userinput = ' '
print "Now tossing a coin.."
while userinput.lower() ! = "q":
flip = random.choice(['heads', 'tails'])
if flip == 'heads' :
headcount += 1
print "heads! the number of heads is now %d" % headcount
@ChrisMoney
ChrisMoney / findLinks.py
Created February 15, 2012 15:38
Python --Find Links
@ChrisMoney
ChrisMoney / encrypt.php
Created February 16, 2012 00:07
PHP - 256k Encryption
<?
/**
* Crypt :: two-way encryption class using RIJNDAEL 256 AES standard
* @uses MCRYPT_RIJNDAEL_256
*
* The MIT License
Copyright (c) 2010 Chris Nizzardini
Permission is hereby granted, free of charge, to any person obtaining a copy
@ChrisMoney
ChrisMoney / assembly_function.s
Last active September 30, 2015 18:07
Assembly - Function computes the value of a number raised to a power
Assembly_Function
#PURPOSE: Program to illustrate hoe functions work. Computes 2^3 + 5^5
# Everything in the main program is stored in registers, so the data section doesn't have anything
.section .data
.section .text
.global _start
@ChrisMoney
ChrisMoney / maximum.s
Created February 16, 2012 01:00
Assembly - Program finds the maximum number of an abstract data set
#Counting Program
#Purpose: This program finds the maximum number of set of data items.
#VARIABLES: The registers have the following uses:
# %edi - Holds the index of the data item being examined
# %ebx = Largest data item found
# %eax - Current data item
#The following memory locations are used:
# data_items - contains the item data. A 0 is used to terminate the data.
@ChrisMoney
ChrisMoney / recursive_function.s
Created February 16, 2012 01:03
Assembly - Recursive function that recursively returns the factorial of various numbers
#Recursive Function
#PURPOSE - Given a number, this program computes the factorial.
# For example, the factorial of 3 is 3*2*1, or 6.
# The factorial of 4 is 4*3*2*1
# This program shows how to call a function recursively
.section .data
@ChrisMoney
ChrisMoney / email_function.vb
Created February 17, 2012 16:38
VB -- Function sends email
Imports System.Net.Mail
Sub aspireReference1Email()
'Get all contents from database for emailing and PDF
Dim credentials As String = Session("UserID")
Dim dt As New DataTable
Dim ASPIRE As String = "ASPIRE"
Dim sqlConn As New SqlConnection(ConfigurationManager.ConnectionStrings("CRTCConnectionString").ConnectionString)
sqlConn.Open()