Skip to content

Instantly share code, notes, and snippets.

View royashbrook's full-sized avatar

Roy Ashbrook royashbrook

View GitHub Profile
Sub FWAP()
Dim OriginalPage As Visio.Page
Set OriginalPage = ActivePage
Dim PagObj As Visio.Page
For Each PagObj In ActiveDocument.Pages
ActiveWindow.Page = PagObj.Name
ActiveWindow.ViewFit = visFitPage
Next PagObj
--table with some test data
select * into #mytable from (
select 1 [id],'one' [value] union all
select 2,'two' union all
select 3,'three' union all
select 4,'four' union all
select 5,'five') st
--bad way passing raw csv string data in
declare @csv varchar(50)
' need tools/references and add a reference to word
Sub InsertDateTime()
' strings to print
Dim t, n, v, delim As String
t = Format(Now(), "YYYY-MM-DD hh:mm:ss") & " EST"
n = "Roy Ashbrook"
delim = " | "
Dim d As Word.Document
using System;
using System.Linq;
using System.Net;
using System.Net.Sockets;
namespace SimpleSniffer
{
static class Program
{
static void Main()
import java.io.*;
import java.util.*;
import javax.crypto.*;
import javax.crypto.spec.*;
public class mcreco {
public static void main(String[] args) throws Exception {
String p = "Path To Your lastlogin file for minecraft";
String r = mcd(p);
Sub MyMacro()
'how to select adjacent cells - http://www.google.com/url?sa=t&rct=j&q=excel%20select%20adjacent%20cells%20vba&source=web&cd=1&ved=0CFoQFjAA&url=http%3A%2F%2Fwww.ozgrid.com%2Fforum%2Fshowthread.php%3Ft%3D89576&ei=iiLNT_bMHqmg2gW1o9yIAg&usg=AFQjCNEia4-TwdJPRit8MKRh69ITAEKpJg
'how to work with the table object - http://www.jkp-ads.com/Articles/Excel2007TablesVBA.asp
'how to loop over the cells in a range- http://www.vbaexpress.com/kb/getarticle.php?kb_id=563
'how to work with only the visible cells - http://www.mrexcel.com/forum/showthread.php?t=66490
'how to click the publish button - http://social.msdn.microsoft.com/Forums/en/tfsgeneral/thread/af266d3f-c288-41c1-8611-97994545afc6
'how to get the name of the current list-http://www.pcreview.co.uk/forums/get-name-active-list-t3872389.html
Dim t As String, w As Worksheet, col As Range, cell As Range, pb As CommandBarControl
Set pb = Application.CommandBars.FindControl(Tag:="IDC_SYNC") 'grab the publish button
-- view all table sizes
-- author: royashbrook - royashbrook@yahoo.com
-- april 2005
select
so.id as [OBJECT_ID],
so.name as [OBJECT_NAME],
coalesce(j_rows.rows,0) as [ROWCOUNT],
coalesce(j_ru.sum_reserved,0) * cast(m.low as dec) / 1024 as [RESERVED (KB)],
d.data * cast(m.low as dec) / 1024 as [DATA (KB)],
(coalesce(j_ru.sum_used,0) - d.data) * cast(m.low as dec) / 1024 as [INDEX (KB)],
-- try and do dirty reads, and turn off the record counting unless you want
-- spam in the middle of your prints below. you can also just do a select
-- instead of a print.
set transaction isolation level read uncommitted
set nocount on
-- vars to hold the commands to queue up and the command var for the one we'll run
-- identity is used to preserve order in case we decide to have a particular order
-- otherwise it will just run in the order we create the commands
declare @command nvarchar(max), @id int
//meant to run in LINQPad
void Main() {
this.ExecuteCommand("set transaction isolation level read uncommitted");
string FindThis = "some text to find";
string q = @"
select
'[' + table_catalog + '].[' + table_schema + '].[' + table_name + ']' [t]
create table #t (
tablename sysname,row_count int,
reserved varchar(50),data varchar(50),
index_size varchar(50),unused varchar(50))
exec sp_msforeachtable 'insert #t exec sp_spaceused ''?'''
select * from #t
drop table #t