Skip to content

Instantly share code, notes, and snippets.

View kckustomac's full-sized avatar
🌴
On vacation

kcKustoMac kckustomac

🌴
On vacation
View GitHub Profile
@TheBrambleShark
TheBrambleShark / AsyncTaskCodeActivity.cs
Last active August 22, 2022 04:13
Open source Task-based Code Activity for use with Workflow Foundation. Licensed under the MIT license.
/*
* AsyncTaskCodeActivity
*
* Copyright (c) LuzFaltex, LLC.
* All rights reserved.
*
* MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software
@steviecoaster
steviecoaster / New-DotNetToast.ps1
Created November 16, 2018 19:48
Create a WIndows 10 Toast notification using .Net
Function New-DotNetToast {
[cmdletBinding()]
Param(
[Parameter(Mandatory, Position = 0)]
[String]
$Title,
[Parameter(Mandatory,Position = 1)]
[String]
$Message,
@kpmiller
kpmiller / TOS-csv-spreadfinder.py
Last active April 16, 2019 12:36
python 2.7 code that reads csv files saved from thinkorswim and applies a scan criteria to it
#!/usr/bin/python
import csv, json, sys, re, os
import glob
try:
loglevel = int(os.environ["LOGLEVEL"])
except:
loglevel = 1
@pudquick
pudquick / sip_config.py
Created December 22, 2016 22:31
Querying active SIP status directly from the kernel, bypassing nvram and csrutil, via python on macOS
# An overly complicated SIP config checker
# This is a technically interesting implementation because it does not rely on csrutil
# Instead it queries the kernel directly for the current configuration status
# This means, for example, in environments where SIP has been disabled and csrutil has
# been removed or modified (say, with DYLD_LIBRARY_PATH), as long as python can run you
# can still check status
# Additionally, checking the nvram csr-active-config setting isn't accurate now with
# 10.12.2+, since running "sudo csrutil clear" deletes the variable until reboot,
@Mike-Honey
Mike-Honey / ExpandAllRecords.M
Created March 22, 2016 21:50
ExpandAllRecords function for Power Query or Power BI - expands all record-type columns recursively
// Based on Chris Webb's blog post - http://blog.crossjoin.co.uk/2014/05/21/expanding-all-columns-in-a-table-in-power-query/
let
//Define function taking two parameters - a table and an optional column number
Source = (TableToExpand as table, optional ColumnNumber as number) =>
let
//If the column number is missing, make it 0
ActualColumnNumber = if (ColumnNumber=null) then 0 else ColumnNumber,
//Find the column name relating to the column number
ColumnName = Table.ColumnNames(TableToExpand){ActualColumnNumber},
@rmontagud
rmontagud / exportexample.php
Last active September 4, 2022 03:24
Export a MySQL dataset to CSV using php://output stream and fputcsv
<?php
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment;filename="export.csv"');
header('Cache-Control: max-age=0');
// See: http://es2.php.net/manual/en/wrappers.php.php
$fpcsv = fopen('php://output', "a+");
// Put your SQL query here
$exportcsv_q = mysql_query($query);
if (@mysql_num_rows($exportcsv_q) > 0) {
$campos = mysql_num_fields($exportcsv_q);