Skip to content

Instantly share code, notes, and snippets.

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}
[PSCredential]::new(0, $SecurePassword).GetNetworkCredential().Password
$REGKEY="HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate"
$REGITEM = "DoNotConnectToWindowsUpdateInternetLocations"
function Set-RegistryItem {
param (
# Registry key to set
[Parameter(Mandatory=$true)]
[string]
$RegistryKey,
--------------------------------------------------------
-- get a list of arguments for specifed stored procedure
--------------------------------------------------------
SELECT
argument_name,
in_out,
data_type
FROM
all_arguments
WHERE
@nexocentric
nexocentric / hiawatha.conf
Created June 6, 2017 03:40
Default /etc/hiawatha/hiawatha.conf on Ubuntu
# From http://secure-ubuntu-server.blogspot.co.id/2015/05/howto-highest-secured-hiawatha-web.html and default conf
# Hiawatha main configuration file
# VARIABLES
# With 'set', you can declare a variable. Make sure the name of the
# variable doesn't conflict with any of the configuration options. The
# variables are case-sensitive and cannot be redeclared.
#
#set LOCALHOST = 127.0.0.0/8
SELECT
Sum(l.cslbr_temp + l.cslbr_wkr) AS TTL,
Sum(l.cslbr_temp) AS Temp,
Sum(l.cslbr_wkr) AS Worker,
l.subprocess_id
FROM
vw_cslabor l,
vm_subprocess s
WHERE
s.SUBPROCESS_ID(+) = l.SUBPROCESS_ID
@nexocentric
nexocentric / gist:1f7087edf126a9315f375c4efba9829c
Created March 27, 2017 18:57
Working with procedures and functions in PL/SQL
DECLARE
x VARCHAR2(8);
BEGIN
x := item_change_mapping_io.iswarehouseitem('01217');
dbms_output.put_line(x);
END;
var rc refcursor;
exec item_change_mapping_io.GetPrimaryGridData(:rc);
print rc;
@nexocentric
nexocentric / gist:7783818
Created December 4, 2013 08:00
ANSI COLOR CODES by name
Pink colors
Pink
LightPink
HotPink
DeepPink
PaleVioletRed
MediumVioletRed
Red colors
LightSalmon
Salmon
function down($array,$element) {
if(count($array)-1 > $element) {
$newArray = array_slice($array,0,$element,true);
$newArray[] = $array[$element+1];
$newArray[] = $array[$element];
$newArray += array_slice(
$array,
$element+2,
count($array),
@nexocentric
nexocentric / gist:f2f6dcf7186c117d04d6
Created October 28, 2014 18:38
Oracle SQL: Natural Numeric Sort Order By Clause
--==========================================================
-- order by natural sort order as in
-- 1, 2.. 10, 11 and not computer sort order
--==========================================================
ORDER BY
to_number(regexp_substr(CHAR_COLUMN,'^[0-9]+')),
to_number(regexp_substr(CHAR_COLUMN,'[0-9]+$')),
CHAR_COLUMN