Skip to content

Instantly share code, notes, and snippets.

View binki's full-sized avatar

Nathan Phillip Brink binki

View GitHub Profile
@binki
binki / Program.cs
Last active March 27, 2019 04:25
MultiDimensionalArray
using System;
namespace MultiDimensionArray
{
class Program
{
static void Main(string[] args)
{
var x = new int[2, 3];
UseArray(x);
C:\Users\ohnob>SET _test=this is ab test of abs.
C:\Users\ohnob>ECHO %_test:*ab=%
test of abs.
C:\Users\ohnob>ECHO %_test:ab=%
this is test of s.
C:\Users\ohnob>ECHO %_test:*ab=%
test of abs.
# Apparently there’s a thing called cycle() for this in python:
>>> x = ['a', 'b', 'c']
>>> [x[i % len(x)] for i in range(0, 20)]
['a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c', 'a', 'b']
@binki
binki / count-to-100.sql
Last active September 2, 2019 05:59
Counting to 100 with recursive CTEs in SQL Server
WITH number AS (SELECT
CAST(1 AS BIGINT) Value
UNION ALL SELECT
n.Value + 1
FROM number n
WHERE n.Value < 100)
SELECT n.Value
FROM number n
ORDER BY n.Value
;
@binki
binki / rockford-community-band-2019-fall-calendar.md
Created September 10, 2019 04:55
Rockford Community Band 2019 Fall Calendar

2019-2020 Rockford Community Band Calendar

Date Description Time
Monday, September 9 Rehearsals Begin
East Rockford MS Bandroom
Subsequent rehearsals each Monday evening
7:00–9:00pm
Monday, October 21 Performance at Porter Hills
Call time: 6:00pm
7:00pm
Monday, October 28 Performance at Breton Woods
Call time: 6:00pm
7:00pm
Sunday, December 8 Holiday Concert
Rockford HS Auditorium
Call time: 2:00pm
3:00pm
Monday, December 9 Performance at Covenant Village
Call time: 6:00pm
7:00pm
Monday, January 6 Rehearsals resume East Rockford MS Bandroom *Subsequent rehearsals each Monday evenin
@binki
binki / rendang-daging.md
Last active May 20, 2024 21:23
Beef Rendang (Rendang Daging)
@binki
binki / oyakodon-recipe.md
Last active January 19, 2022 16:36
Oyakodon Recipe (親子丼)
void setup()
{
byte b[] = loadBytes("ih.mid");
for (int i = 0; i < b.length && i < 16; i++)
{
if ((i % 10) == 0)
{
println();
}
@binki
binki / SimpleCsvQuoteString.vb
Last active October 22, 2019 15:48
Example of quoting CSV in VB.Net
Imports System
Public Module Program
Public Sub Main()
Dim num = 23
Dim value = "This is some text, but it is free-form and might have double quotes ("") in it"
Dim value2 = "Text with a" & Environment.NewLine & "newline"
Console.WriteLine(QuoteCsvField(value) & "," & QuoteCsvField(value2) &"," & num)
End Sub
Public Function QuoteCsvField(value As String) As String
Return """" & value.Replace("""", """""") & """"
@binki
binki / SimpleCsvQuoteString.cs
Last active October 22, 2019 15:50
Example of quoting CSV in C#
using System;
public static class Program {
public static void Main() {
var num = 23;
var value = "This is some text, but it is free-form and might have double quotes (\") in it";
var value2 = "Text with a\r\nnewline";
Console.WriteLine(QuoteCsvString(value) + "," + QuoteCsvString(value2) + "," + num);
}
public static string QuoteCsvString(string value) {
return "\"" + value.Replace("\"", "\"\"") + "\"";