View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View MainPrompt.vb
Module MainPrompt
Public Const PromptSymbol As String = "TLA > "
Public Const ApplicationTitle As String = "Short name of the application"
Sub Main()
Dim Statement As String
Dim BrokenDownStatement As String()
Dim Command As String
Dim Args As String()
Dim Result As String
View SysUpTime.vb
Public Class SysUpTime
Public ReadOnly Property ErrorInResult As Boolean
Public ReadOnly Property ErrorDetails As String
Public ReadOnly Property LastStartup As DateTime
Get
Return DateTime.Now.Subtract(_UpTimeSpan)
End Get
End Property
Public ReadOnly Property UpTimeString As String
View Luhn.net
Public Function Luhn(StringToCheck As String) As String
Dim CurrDigit As Integer
Dim TotalCounter As Integer
Dim DoubleDigit As Integer
TotalCounter = 0
For i = StringToCheck.Length To 1 Step -1
Try
CurrDigit = Integer.Parse(StringToCheck(i - 1))
View Query WHOIS
Public Class clsWhoIs
Public Enum registry
whois_arin_net = 0
whois_ripe_net = 1
whois_apnic_net = 2
End Enum
Function test(ByVal ipAddress As String, ByVal queryTo As registry) As String
Dim tcpc As New TcpClient()
Dim strDomain As String
Dim arrDomain As Byte()
View Text file manipulator
Imports System.IO
Imports System.Text
Imports System.Net
Module modText
Function textFromInternet(ByVal address As String) As StringBuilder
Dim Request As WebRequest
Dim Response As WebResponse
Dim Reader As StreamReader
Dim Line As String
View Images from website
Imports System.Net
Imports System.IO
Module modImages
Function getimages() As Boolean
Dim prefixFull As String = "http://www.yoursite.com/images/"
Dim prefixShort As String = "http://www.yoursite.com"
Dim basePath As String = "c:\your path here"
Dim imgClient As WebClient
View MD4 Visual Basic .net
'Copyright (c) 2000 Oren Novotny (osn@po.cwru.edu)
'Permission is granted to use this code for anything.
'Derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm.
'http://www.rsasecurity.com">RSA Data Security, Inc.</a> requires
'attribution for any work that is derived from the MD4 Message-Digest
'Algorithm; for details see <a href="http://www.roxen.com/rfc/rfc1320.html">
'RFC 1320</a>.
'This code is ported from Norbert Hranitzky's
'(norbert.hranitzky@mchp.siemens.de)
View CIN Calculator
Module modCIN
Friend Const CINLetters As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ-. "
Friend Const CINDigits As String = "0123456789"
Friend Const Divisor As Integer = 26
Friend CINEvenList As Integer() = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28}
Friend CINOddList As Integer() = {1, 0, 5, 7, 9, 13, 15, 17, 19, 21, 2, 4, 18, 20, 11, 3, 6, 8, 12, 14, 16, 10, 22, 25, 24, 23, 27, 28, 26}
Function CalcCIN(ByVal ABI As String, ByVal CAB As String, ByVal Account As String) As String
View WOL.net
Imports System.Net
Imports System.Net.Sockets
Imports System.Text
Public Class clsWOL
Const lenHeader As Integer = 6
Const lenMAC As Integer = 6
Const repMAC As Integer = 16
Dim mEndPoint As IPEndPoint