Skip to content

Instantly share code, notes, and snippets.

View hanleybrand's full-sized avatar

Peter Hanley hanleybrand

View GitHub Profile
/*
Common Queries for Beginners
December 17, 2010 12:01 PM
Hello Everyone. Below is a list of common queries a gentlemen at Blackboard Managed Hosting gave me a while back. This list of queries is a great starting point to get to know the ASR side of Blackboard. There are a few things you need to be aware of before copying and pasting these into your favorite query analyzer:
Aqua Data Studio does not end its statements with semicolons like this ;
Some queries may not work without modification.
If you feel like the query you are running is going to pull a large amount of data, use where rownum <= 10 at the end of your statement, this will limit your findings to 10 rows of data.
{
"kind": "youtube#playlistItemListResponse",
"pageInfo": {
"totalResults": 219,
},
"items": [
{
"kind": "youtube#playlistItem",
"etag": "\"gMxXHe-zinKdE9lTnzKu8vjcmDI/zrVbKiXDAfk6FrNiElsk22qcJIw\"",
"id": "UEw4QTU3QTdFNzMxMTQ3ODI1LjYxNUZFREI1NkNDNUZFQTc=",
@hanleybrand
hanleybrand / freetds_with_gnutls.rb
Created July 21, 2016 17:12
A modified version of the homebrew freetds formula with support added for gnutls as an alternative (?) to openssl -- *? using the `--with-gnutls` switch seems to disable openssl support
class Freetds < Formula
desc "Libraries to talk to Microsoft SQL Server and Sybase databases"
homepage "http://www.freetds.org/"
url "ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.9.tar.bz2"
mirror "https://fossies.org/linux/privat/freetds-1.00.9.tar.bz2"
sha256 "3a91ce6321ac3c951281ce908f3eae40a0b6d1101b3322cac0602f62c006cb6c"
bottle do
sha256 "934404b4fbc59469df94f6ed71887fc75a7c69556c64cad024d478be3de85e7c" => :el_capitan
sha256 "b753cb2b0a6e4a09f27e2852cc60bfc8ee90c5e5e48c5c466ae87df6190bcb57" => :yosemite
@hanleybrand
hanleybrand / Amethyst_Ore_Spire_Rarer.tml
Created April 7, 2016 19:39
Ruins template to generate an Ore Spire containing amethest from biomes of plenty. "Rarer" version
weight=10
embed_into_distance=5
unacceptable_target_blocks=flowing_water,water,flowing_lava,lava
dimensions=33,13,13
allowable_overhang=0
max_leveling=3
leveling_buffer=-1
@hanleybrand
hanleybrand / Amethyst_Outcrop.tml
Created April 7, 2016 19:33
Ruins template for MC 1.7.10 to generate an Ore Spire containing amethest from biomes of plenty.
## spawns an andesite outcrop with up to 50 possible amethyst ore
## Avg seems around 2-8 actual spawns - this can be changed by editing rules 5,6,7
weight=3
embed_into_distance=2
unacceptable_target_blocks=flowing_water,water,flowing_lava,lava
dimensions=8,7,7
allowable_overhang=0
max_leveling=-1
@hanleybrand
hanleybrand / Amethyst_Ore_Spire_Plentiful.tml
Last active April 7, 2016 19:04
Ruins template to generate an Ore Spire containing amethest from biomes of plenty. Plentiful version
weight=10
embed_into_distance=5
unacceptable_target_blocks=flowing_water,water,flowing_lava,lava
dimensions=33,13,13
allowable_overhang=0
max_leveling=3
leveling_buffer=-1
preserve_water=0
preserve_lava=0
preserve_plants=1
@hanleybrand
hanleybrand / rubric_report_sp_creates.sql
Last active March 29, 2016 16:37
rubric reports (create the stored procedures). I just run these via a powershell script right now, you can see it at https://gist.github.com/hanleybrand/e448e2bc8bdcf7d58c97 note that these are written against an earlier database schema version, but I looked over the change logs and don't see any changes, so fingers crossed ;-)
use [Roadmap]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- get a list of rubrics from a course - select returns (among other things) a number of pk1s
CREATE procedure [dbo].[SP_RUBRIC_LIST_FOR_COURSE_PK1]
@COURSE_PK1 int
@hanleybrand
hanleybrand / db.php
Created March 17, 2016 20:09
php db code from learnyouphp
<?php
$old_name = $argv[2];
$new_name = 'David Attenborough';
$pdo = new \PDO($argv[1]);
foreach ($pdo->query('SELECT * FROM users') as $row) {
if ($row['age'] > 30 ) {
[22:32:03] [Client thread/INFO]: Warning: Clientside chunk ticking took 326 ms
[22:33:18] [Client thread/INFO]: Warning: Clientside chunk ticking took 117 ms
[22:33:18] [Client thread/INFO]: Warning: Clientside chunk ticking took 124 ms
[22:33:19] [Client thread/INFO]: Warning: Clientside chunk ticking took 116 ms
[22:33:19] [Client thread/INFO]: Warning: Clientside chunk ticking took 120 ms
[22:33:19] [Client thread/INFO]: Warning: Clientside chunk ticking took 121 ms
[22:33:19] [Client thread/INFO]: Warning: Clientside chunk ticking took 124 ms
[22:33:19] [Client thread/INFO]: Warning: Clientside chunk ticking took 108 ms
[22:33:20] [Client thread/INFO]: Warning: Clientside chunk ticking took 116 ms
[22:33:20] [Client thread/INFO]: Warning: Clientside chunk ticking took 111 ms