Skip to content

Instantly share code, notes, and snippets.

View jackaperkins's full-sized avatar

Jack Perkins jackaperkins

View GitHub Profile
```markdown
# Real news
## not fake
- Bam margera just died today 29/01/2017 german standard time
using UnityEngine;
using System.Collections;
public class SyncPortalCamera : MonoBehaviour {
public GameObject axisA, cameraA, axisB, renderCamera;
public Texture renderTarget;
// Use this for initialization
void Start () {
//cameraA.GetComponent<Camera>().main
Shader "Unlit/Unlit ScreenSpace" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" "Queue" = "Geometry"}
@jackaperkins
jackaperkins / settexture.cs
Last active March 10, 2016 02:56
sets texture on block for later use in unity
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class SetMaterial : MonoBehaviour {
public Texture2D texture;
private MaterialPropertyBlock prop;
void OnRenderObject () {
// materialpropertyblock is what components pass data into, then to the shader
@jackaperkins
jackaperkins / thing.js
Last active February 15, 2016 20:08
plugin format
// our plugin data that comes back from the plugin API
var plugin = {
name: "jacks cool script",
body: "var p ={actionName: \"orderPizza\", action: function () { var x = 1;}}"
}
// body is a string of raw javascript code, not JSON encoded;
// when we call eval on it, it'll create a local variable which we can then use:
var p = {
{
commands: {
'(magic number)': actions.magicNumber
},
actions: {
magicNumber: function () {
console.log("you magic number is 5");
}
}
}
@jackaperkins
jackaperkins / gist:8465204
Created January 16, 2014 23:03
WWW API 3 Release notes

new features

  • explore page trending tags have a new display
  • Skill page redesign
  • new embeded video player for DIY projects
  • Challenge page redesign, auto embeding of primary video example, tabs for more examples
  • Maker Email addresses, all makers have email fields in their settings panel
  • added skill achievments to most project lists (stream, portfolios etc)
  • normalize tab design in market / challenge to look like explore
@jackaperkins
jackaperkins / gist:8428894
Last active January 3, 2016 07:19
patch grid

Hex Grid

The base hex grid renderer should return markup

var grid = new HexGrid({
  size: [100, 120], // size in pixels per patch
  offset: [200, 120], // offset for 0,0 point (centering offset)
  template: patchTemplate
});

$('#my-relative-container').append(grid.render(mySkill));
<div class="projects explore fontface favorites-disabled recede" id="projects">
<div class="projects">
<ul id="projects-list">
<div class="hex-loader medium"></div>
</ul>
</div>
<div id="pagination" class="pagination"></div> <!-- more will appear here -->
</div>