Skip to content

Instantly share code, notes, and snippets.

View dayneo's full-sized avatar

Dayne Olivier dayneo

View GitHub Profile
@dayneo
dayneo / .gitconfig
Created June 27, 2024 15:54
~/.gitconfig
[user]
email = dayneo@gmail.com
name = dayneo
[init]
defaultBranch = master
[pull]
rebase = true
[alias]
graph = log --graph --pretty=format:'%C(auto,yellow)%h %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(6,trunc)%aN %C(auto,red)% gD% D %C(auto,reset)%s' --date=relative --abbrev-commit
@dayneo
dayneo / setseq.sql
Created July 20, 2017 19:02
Moves an Oracle sequence number to the desired value.
SET FEEDBACK OFF;
SET SERVEROUTPUT ON SIZE 1000000;
set verify off
set trimspool on
set linesize 4000
ACCEPT seq_name CHAR PROMPT 'Sequence name: ';
ACCEPT seq_value NUMBER PROMPT 'Value: ';
@dayneo
dayneo / CsvImportUtiltiy.cs
Last active September 23, 2016 09:46
CSV import utility class.
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
/// <summary>
/// Improts csv data from a file.
/// </summary>
/// <remarks>
/// https://msdn.microsoft.com/en-us/library/ms709353(v=vs.85).aspx
@dayneo
dayneo / resizehdd.bat
Created June 10, 2016 11:18
Batch script to resize a virtualbox hdd.
@echo off
set path=%ProgramFiles%\Oracle\VirtualBox;%path%
set /P size=New size (MB):
VBoxManage modifyhd %1 --resize %size%
@dayneo
dayneo / AsyncDataTaskHelper.cs
Last active October 6, 2016 08:21
Assists in the management of asynchronous execution of data service queries and their cancellations.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data.Services.Client;
using System.Data.Services.Exceptions;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@dayneo
dayneo / EventedConverter.cs
Created March 17, 2016 07:22
Provides event based formatting and parsing. (WPF)
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
/// <summary>
/// Provides data for the Format and Parse events.
/// </summary>
public class ConvertEventArgs : EventArgs
{
@dayneo
dayneo / BitFlagBehaviour.cs
Created March 16, 2016 17:06
Adds ability to perform bitwise operations using a checkbox. (WPF)
using System;
using System.Windows;
using System.Windows.Controls;
/// <summary>
/// Adds ability to perform bitwise operations using a checkbox.
/// </summary>
public class BitFlagBehaviour : DependencyObject
{
/// <summary>
@dayneo
dayneo / IndexAccessibleListCollectionView.cs
Created February 11, 2016 16:44
Extends ListCollectionView to provide indexer based access to CollectionViewSource sources in XAML binding.
using System;
using System.Collections;
using System.Windows.Data;
public class IndexAccessibleListCollectionView : ListCollectionView
{
public IndexAccessibleListCollectionView(IEnumerable collection)
: base(new ArrayList())
{
foreach (object item in collection)
@dayneo
dayneo / xcopy.sql
Last active February 9, 2016 11:33
SQL/Plus script to copy data from one schema to another matching schema. In particular, the script does not copy LOB fields which often account for the majority of the data and cannot be copied accross a dblink.
SET FEEDBACK OFF;
SET SERVEROUTPUT ON SIZE 1000000;
set trimspool on
set linesize 4000
SPOOL %TEMP%\xcopy.sql
exec dbms_output.put_line('');
exec dbms_output.put_line('SET FEEDBACK ON;');
exec dbms_output.put_line('SET SERVEROUTPUT ON;');
@dayneo
dayneo / cls.sql
Last active August 22, 2016 15:00
Oracle SQL/PLus script to generate a script that will clear a schema of all objects without dropping the user.
SET FEEDBACK OFF;
SET SERVEROUTPUT ON;
SPOOL %TEMP%\clearschema.sql
exec dbms_output.put_line('');
exec dbms_output.put_line('SET FEEDBACK ON;');
exec dbms_output.put_line('SET SERVEROUTPUT ON;');
exec dbms_output.put_line('');