Skip to content

Instantly share code, notes, and snippets.

Rob Bennet robbennet

Block or report user

Report or block robbennet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@robbennet
robbennet / Example.cs
Created Jun 4, 2016
Unity3D threading with "anonymous" functions, callbacks, asyc and synchronous methods
View Example.cs
using UnityEngine;
public class Example : MonoBehaviour {
void Awake() {
ThreadAction job = new ThreadAction(HeavyLifting);
job.OnComplete += () => { Debug.Log("we're back"); };
job.Start();
StartCoroutine(job.WaitFor()); // asynchronous
@robbennet
robbennet / app.js
Created Jan 10, 2016
Serve static files from a directory.
View app.js
var connect = require('connect');
var serveStatic = require('serve-static');
connect().use(serveStatic(__dirname)).listen(49974);
@robbennet
robbennet / React_basics
Created Jan 7, 2016
Simple React Example
View React_basics
"use strict";
var HelloMessage = React.createClass({
displayName: "HelloMessage",
render: function render() {
return React.createElement(
"div",
null,
"Hello ",
View jsbin.jicef.css
/* Put your CSS here */
html, body {
margin: 20px;
}
@robbennet
robbennet / overwrite.php
Created Nov 4, 2013
WordPress overwrite existing files on file upload if it exists.
View overwrite.php
add_filter('wp_handle_upload_overrides','nonUniqueFilename');
function nonUniqueFilename($overrides){
$overrides['test_form'] = false;
$overrides['unique_filename_callback'] = 'nonUniqueFilenameCallback';
return $overrides;
}
function nonUniqueFilenameCallback($directory, $name, $extension){
$filename = $name . strtolower($extension);
You can’t perform that action at this time.