Skip to content

Instantly share code, notes, and snippets.

View Siliconrob's full-sized avatar
🌎
🙈 🙉 🙊

Robin Michael Siliconrob

🌎
🙈 🙉 🙊
View GitHub Profile
@Siliconrob
Siliconrob / deploy.yml
Created April 24, 2020 00:24 — forked from ceejbot/deploy.yml
an example of a github action that updates other repo actions & secrets on a push
name: deploy service tar
on:
push:
branches:
- 'deploy/*'
jobs:
update:
name: Update target service Github deploy workflows
runs-on: ubuntu-latest
@Siliconrob
Siliconrob / IDBConnectionExtensions.cs
Created January 3, 2020 15:51
Extension methods on IDBConnection to generate random data from Database methods (MS SQL)
using System;
using System.Data;
using System.Threading.Tasks;
using Dapper;
public static class IDbConnectionExtensions
{
public static async Task<DateTime> DbGeneratedFakeDateOfBirthAsync(this IDbConnection db, int range = 100)
{
if (range < 1 || range > 100)
using System;
namespace EqualTest
{
class Program
{
static void Main(string[] args)
{
var ohdear = new
{

Keybase proof

I hereby claim:

  • I am siliconrob on github.
  • I am siliconrob (https://keybase.io/siliconrob) on keybase.
  • I have a public key ASCjmM1Av05-0SkhTvUnpoCmeE45Kh0W5HEbfWKojH7lgAo

To claim this, I am signing this object:

@Siliconrob
Siliconrob / main.py
Created May 2, 2018 14:15
Read Weather Underground for DateTime and return sky condition
import sys
from pprint import pprint
import arrow
from WunderWeather import weather
def eclipse_conditions(api_key, lat, lng, start_time_utc, end_time_utc):
if (start_time_utc > end_time_utc):
raise Exception('Start time must be less than end time')
extractor = weather.Extract(api_key)
location = "{0},{1}".format(lat, lng)
@Siliconrob
Siliconrob / https_get.c
Last active March 27, 2018 19:44
HTTPS Solcast API GET
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
@Siliconrob
Siliconrob / add_partition.sql
Created August 11, 2017 19:03 — forked from danclien/add_partition.sql
Queries I used to import ALB logs into AWS Athena. Based off of https://medium.com/@robwitoff/athena-alb-log-analysis-b874d0958909
ALTER TABLE your_table_name_here
ADD PARTITION (year='2017', month='*', day='*')
LOCATION 's3://your-alb-log-bucket/processed/AWSLogs/00000-change-with-your-account-id/elasticloadbalancing/us-east-1-change-with-your-region/2017/'
@Siliconrob
Siliconrob / CreateTables.sql
Created June 23, 2017 05:44
SqlDependencyEx - TableListener Example
/****** Object: Table [dbo].[Table1] Script Date: 6/22/2017 10:42:23 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Table1](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Description] [nchar](10) NULL,
@Siliconrob
Siliconrob / DelayCounter.cs
Created June 3, 2017 20:04 — forked from davidfowl/DelayCounter.cs
Count up from 0 to {count}, showing an item every {delay} milliseconds
public IObservable<int> ObservableCounter(int count, int delay)
{
return Observable.Range(0, count).Zip(
Observable.Interval(TimeSpan.FromMilliseconds(delay)), (item, _) => item);
}