Skip to content

Instantly share code, notes, and snippets.

@mikelovesrobots
mikelovesrobots / .gitignore
Created February 26, 2018 22:18
react-native gitignore
# OSX
#
.DS_Store
# React Native
#
/node_modules
/ios/kif_screenshots/
*.jsbundle*
local LCS = require 'LCS'
local System = require 'knife.system'
local drawImage = require 'systems.drawImage'
local drawBackgroundColor = require 'systems.drawBackgroundColor'
local fadeIn = require 'systems.fadeIn'
local colors = {
white = {255, 255, 255, 255},
lightGreen = {208, 231, 153, 255},
lightPink = {251, 239, 244, 255},
Shader "Hidden/RedOffsetShader" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Pass {
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
@mikelovesrobots
mikelovesrobots / drone.yml
Created July 25, 2017 23:30
one way of using yaml features to DRY up drone.yml
invalidate-cloudfront-common: &invalidate-cloudfront-common
image: cgswong/aws:aws
commands:
- aws configure set preview.cloudfront true
- aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths "/*"
secrets: [AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY]
pipeline:
invalidate-cloudfront-dev:
<<: *invalidate-cloudfront-common
import { sample } from 'lodash'
export default class TitleGenerator {
static generate() {
return sample(this.phrases())
}
static phrases() {
return [
`${sample(this.gibberish())} the ${sample(this.adjectives())} aspect ${sample(this.rises())}. ${sample(this.gibberish())} ${sample(this.interrogations())}`,
@mikelovesrobots
mikelovesrobots / gist:abaf9e651652f480facf39a16395ea4a
Last active March 7, 2017 01:02
How Substantial keeps things going smoothly [outline]
Organizational Tools:
* Trello for prioritizing the most important thing to be working on next
(typically divided into backlog, doing, review and done columns)
* Github pull requests before merging code to master
(not just programmers: artists and other interested parties have a say too)
Regular Meetings:
* Morning team standups
@mikelovesrobots
mikelovesrobots / MikeBlindBot.rb
Created December 2, 2016 00:58
Rtanque Bot 2 - no longer so blind
class MikeBlindBot < RTanque::Bot::Brain
NAME = 'MikeBlindBot2'
include RTanque::Bot::BrainHelper
TURRET_FIRE_RANGE = RTanque::Heading::ONE_DEGREE * 1.0
def tick!
## main logic goes here
@direction_degrees ||= 0
if self.sensors.position.on_top_wall?
class MikeBlindBot < RTanque::Bot::Brain
NAME = 'MikeBlindBot'
include RTanque::Bot::BrainHelper
def tick!
## main logic goes here
@direction_degrees ||= 0
if self.sensors.position.on_top_wall?
@direction_degrees = -180
elsif self.sensors.position.on_bottom_wall?
using UnityEngine;
using System;
using System.Collections;
public class CheatActivator : MonoBehaviour {
private DateTime ClickedAt;
private const int MIN_SECONDS = 5;
private const string CHEAT_SCENE = "Cheats";
public void OnPress(bool isDown) {
@mikelovesrobots
mikelovesrobots / gist:f8aeb8cc5ccb1b97bc61
Created April 17, 2015 18:42
ParseSafeInitializeBehaviour
using UnityEngine;
using System.Collections;
using Parse;
// Parse for Unity3d stops responding if it gets initialized twice
// or the original initialization goes away (e.g., you leave the scene)
// so use this instead of the regular ParseInitializeBehaviour, and
// throw it in every scene that you need to talk to Parse in
public class ParseSafeInitializeBehaviour : ParseInitializeBehaviour {