Skip to content

Instantly share code, notes, and snippets.

View lookitstony's full-sized avatar

Tony Rose lookitstony

  • Jacksonville, FL
View GitHub Profile
@lookitstony
lookitstony / Tickets Related To Current User.jql
Created August 4, 2016 17:48
Jira JQL to select all open tickets that have anything to do with the current user.
@lookitstony
lookitstony / hosts.ps1
Created July 7, 2016 18:34 — forked from markembling/hosts.ps1
Powershell script for adding/removing/viewing entries to the hosts file.
#
# Powershell script for adding/removing/showing entries to the hosts file.
#
# Known limitations:
# - does not handle entries with comments afterwards ("<ip> <host> # comment")
#
$file = "C:\Windows\System32\drivers\etc\hosts"
function add-host([string]$filename, [string]$ip, [string]$hostname) {
SELECT
(
dp.state_desc + ' ' +
dp.permission_name collate latin1_general_cs_as +
' ON ' + '[' + s.name + ']' + '.' + '[' + o.name + ']' +
' TO ' + '[' + dpr.name + ']'
) AS GRANT_STMT
FROM sys.database_permissions AS dp
INNER JOIN sys.objects AS o ON dp.major_id=o.object_id
INNER JOIN sys.schemas AS s ON o.schema_id = s.schema_id
@lookitstony
lookitstony / Configure TFS.cmd
Created March 17, 2016 18:36
Batch file to setup TFS a distributed VM that multiple people will be using.
@echo off
SET me=%~n0
SET parent=%~dp0
SET log=%TEMP%\%me%.txt
SET %ERRORLEVEL%=0
echo ============================================
echo %me%
echo ============================================
@lookitstony
lookitstony / SqlTryCatch.sql
Created December 10, 2015 14:01
Basic try catch setup for sql scripts
begin tran
begin try
-- sql code
commit tran
end try
begin catch
rollback tran
declare @errorMessage nvarchar(4000) = error_message()
@lookitstony
lookitstony / ..Fix NPM SSL Errors.md
Last active November 30, 2015 21:50
Getting around corporate SSL configuration by turning Strict-SSL off.

This will fix SSL errors in the following tools

  • Node
  • Npm
  • Bower
  • Tsd
  • Git

Node Command: setx NODE_TLS_REJECT_UNAUTHORIZED 0

using UnityEngine;
using System.Collections;
public static class Vibration
{
#if UNITY_ANDROID && !UNITY_EDITOR
public static AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
public static AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
public static AndroidJavaObject vibrator = currentActivity.Call<AndroidJavaObject>("getSystemService", "vibrator");
/***
* This script will anchor a GameObject to a relative screen position.
* This script is intended to be used with CameraFit.cs by Marcel Căşvan, available here: http://gamedev.stackexchange.com/a/89973/50623
*
* Note: For performance reasons it's currently assumed that the game resolution will not change after the game starts.
* You could not make this assumption by periodically calling UpdateAnchor() in the Update() function or a coroutine, but is left as an exercise to the reader.
*/
/* The MIT License (MIT)
Copyright (c) 2015, Eliot Lash
var MultiGetSet = function(opt){
var getType = function(o) {
return ({}).toString.call(o).match(/\s([a-zA-Z]+)/)[1].toLowerCase()
};
if(!opt.public || !opt.private)
return opt.public;
if(opt.handler && opt.handler.init)
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/