Skip to content

Instantly share code, notes, and snippets.

@gcusso
gcusso / Microsoft.PowerShell_profile.ps1
Last active December 26, 2020 17:39
Windows Terminal settings
# https://www.hanselman.com/blog/how-to-make-a-pretty-prompt-in-windows-terminal-with-powerline-nerd-fonts-cascadia-code-wsl-and-ohmyposh
$DefaultUser = "gcuss"
Import-Module posh-git
Import-Module oh-my-posh
Import-Module ZLocation
Set-Theme Paradox
if ($host.Name -eq 'ConsoleHost')
{
@gcusso
gcusso / charp.json
Created May 18, 2019 08:51
Unity csharp snippets for vs Code
{
// Place your snippets for csharp here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
"Debug.Log($1);",
@gcusso
gcusso / settings.json
Created May 18, 2019 08:50
vs code settings
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "Inconsolata",
"editor.fontSize": 17,
"git.autofetch": false,
"window.zoomLevel": 1,
"python.linting.pylintArgs": [
"--disable=C",
"--extension-pkg-whitelist=ujson",
"--extension-pkg-whitelist=cv2"
@gcusso
gcusso / CoordConvLayer.py
Last active August 8, 2021 04:14
Extracted CordConvs tensorflow implementation from (An intriguing failing of convolutional neural networks and the CoordConv solution) https://arxiv.org/pdf/1807.03247.pdf
from tensorflow.python.layers import base
import tensorflow as tf
class AddCoords(base.Layer):
"""Add coords to a tensor"""
def __init__(self, x_dim=64, y_dim=64, with_r=False):
super(AddCoords, self).__init__()
self.x_dim = x_dim
self.y_dim = y_dim
@gcusso
gcusso / p5&p5play.js
Created June 24, 2018 15:29
p5.js v0.6.1 & p5.play in a single file
/*! p5.js v0.6.1 April 27, 2018 */ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.p5=a()}}(function(){var a;return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c||a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){!function(a){"use strict";function b(a){var b=a.charCodeAt(0);return b===f||b===k?62:b===g||b===l?63:b<h?-1:b<h+10?b-h+26+26:b<j+26?b-j:b<i+26?b-i+26:void 0}function c(a){function c(a){j[l++]=a}var d,f,g,h,i,j;if(a.length%4>0)throw new
@gcusso
gcusso / watch.cs
Created April 7, 2016 15:04
Class to measure time spend in code in a Unity Project
using UnityEngine;
public class Watch
{
private double startTime;
private double endTime;
public Watch()
{
Start ();
@gcusso
gcusso / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-progress/paper-progress.html">
<link rel="import" href="../paper-toast/paper-toast.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@gcusso
gcusso / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@gcusso
gcusso / designer.html
Created November 22, 2014 10:27
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
<style>