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 / 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 / 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 / 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 / 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 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 / main.html
Last active January 21, 2016 23:53
Meetup 1/21/16 - Checkpoint 1
<!doctype html>
<html ng-app="editor">
<head>
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css"/>
<script src="bower_components/ace-builds/src-min-noconflict/ace.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-ui-ace/ui-ace.js"></script>
<script src="libs/ui-bootstrap-tpls-1.1.0.min.js"></script>
@jbasinger
jbasinger / iconextractor.cs
Last active October 29, 2023 14:39
Icon Extraction in Windows using NodeJS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Drawing;
using System.IO;
using Newtonsoft.Json;
@jbasinger
jbasinger / csharp.cs
Last active November 13, 2015 22:10
Platform Specifics
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading; //Had to add this.
using System.Threading.Tasks;
namespace ConsoleApplication1 {
class Program {
static void Main(string[] args) {
@jbasinger
jbasinger / index-worker.js
Last active October 30, 2015 00:26
Remote Control Firefox!
var pageWorkers = require("sdk/page-worker");
pageWorker = pageWorkers.Page({
contentURL: self.data.url("worker.html"),
contentScriptFile: [self.data.url('jquery-2.1.4.min.js'),self.data.url('worker.js')],
contentScriptWhen: "ready"
});
pageWorker.port.on('command', function(cmd){
@jbasinger
jbasinger / files.js
Last active October 20, 2015 01:23
Karma config
files: [
'../lib/ionic/js/ionic.bundle.js',
'../lib/angular-mocks/angular-mocks.js',
'../js/**.js',
'./**.spec.js'
],