Skip to content

Instantly share code, notes, and snippets.

View jbasinger's full-sized avatar
🔮
One sec

Justin Basinger jbasinger

🔮
One sec
View GitHub Profile
@jbasinger
jbasinger / index.js
Created January 22, 2016 00:20
Meetup 1/21/16 - Checkpoint 2
var app = require('app');
var BrowserWindow = require('browser-window');
var ipc = require('electron').ipcMain;
var dialog = require('dialog');
var fs = require('fs');
var editorWindow;
app.on('ready', function(){
@jbasinger
jbasinger / index.js
Created January 22, 2016 00:48
Meetup 1/21/16 - Final Checkpoint
var app = require('app');
var BrowserWindow = require('browser-window');
var ipc = require('electron').ipcMain;
var dialog = require('dialog');
var fs = require('fs');
var editorWindow;
app.on('ready', function(){
@jbasinger
jbasinger / index.js
Created February 2, 2016 02:00
Can't register 'super+space' in Windows with Electron
var app = require('app');
var globalShortcut = require('global-shortcut');
app.on('ready', function(){
var win_space = globalShortcut.register('super+space', function(){
console.log('This is rubbish!');
});
if(!win_space){
@jbasinger
jbasinger / RandomModelGenerator.cs
Created January 13, 2017 01:46
A simple script for Unity where you can put in a list of prefabs to pull from randomly
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RandomModelGenerator : MonoBehaviour {
public GameObject[] prefabs;
public int seed;
// Use this for initialization
@jbasinger
jbasinger / showIndexPathsOnCells.m
Created March 23, 2017 17:37
A function that'll throw a label on a cell with it's index path. Useful for debugging weird layouts.
-(void)showIndexPath:(NSIndexPath*)indexPath inView:(UIView*)view{
UILabel *lbl = [[UILabel alloc] init];
lbl.text = [NSString stringWithFormat:@"%ld-%ld", (NSUInteger)indexPath.section, (NSUInteger)indexPath.item];
lbl.font = [UIFont systemFontOfSize:8.f];
lbl.numberOfLines = 0;
lbl.backgroundColor = [UIColor blackColor];
lbl.textColor = [UIColor whiteColor];
@jbasinger
jbasinger / Dockerfile
Last active September 21, 2020 16:34
An easy docker-compose that sets up an MSSQL server container with shared backup and scripts folders and a couple scripts to restore backups
FROM ubuntu:latest
ENV TERM xterm-256color
WORKDIR /root
RUN apt-get update \
&& apt-get install -y \
ripgrep \
jq \
zsh \
curl \
git
version: 0.2
phases:
build:
commands:
- set -e
- mkdir ./build
- cp ./public/** ./build
- aws s3 sync ./build s3://simple-cloud-formation
@jbasinger
jbasinger / buildspec.yml
Last active November 29, 2020 17:22
Updated codebuild policy to allow access to cloudfront invalidations
version: 0.2
phases:
build:
commands:
- set -e
- docker-compose up -d site
- docker cp serverless-blazor:/app/ServerlessBlazor/build/wwwroot .
- docker-compose down
- aws s3 sync ./wwwroot s3://<YOUR S3 BUCKET NAME>
@jbasinger
jbasinger / CodeSnippet.razor
Last active January 2, 2021 18:02
Blazor Code Snippet Components
<pre class="code"><code class="@Language">
@ChildContent
</code></pre>
@code {
[Inject] private IJSRuntime _js { get; set; }
[Parameter] public RenderFragment ChildContent { get; set; }
[Parameter] public string Language { get; set; } = "csharp";
@jbasinger
jbasinger / twosum.cs
Created January 27, 2021 01:28
Leet Code Problem 1 Two Sum
namespace LeetCode
{
public class TwoSum_Problem
{
public static int[] TwoSum(int[] nums, int target)
{
for (int i = 0; i < nums.Length; i++)
{
for (int j = i+1; j < nums.Length; j++)
{