Skip to content

Instantly share code, notes, and snippets.

View cp's full-sized avatar
:shipit:

Colby Aley cp

:shipit:
View GitHub Profile
@cp
cp / machine.js
Last active June 29, 2022 18:19
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions

Keybase proof

I hereby claim:

  • I am cp on github.
  • I am colby (https://keybase.io/colby) on keybase.
  • I have a public key whose fingerprint is AE96 399D B2B3 6EB7 AF4D B83C 8B58 5716 F9E2 ECB0

To claim this, I am signing this object:

/*jshint node:true*/
'use strict';
module.exports = function(/* environment, appConfig */) {
return {
reflect: {
css: '...'
}
};
};
@cp
cp / overrides.md
Last active April 28, 2016 17:53
Reflect Overrides

Reflect Overrides

We built overrides as a way of customizing individual components at runtime. This can be useful for dynamically altering a component based on it's current environment.

Overrides use JSONPath to manipulate your view's configuration. The documentation on JSONPath's syntax can be found here.

Here's an example of supplying Reflect.js with overrides. Specifically, we're setting the dimensions of a component with id #1.

var ui = new ReflectUI(token),

overrides = [

@cp
cp / gist:6f50fb52d3dfbb388060
Created December 9, 2014 22:44
java stack implimentation
class Stack {
private Object[] array;
private int tos = -1;
private int size;
Stack(int size) {
this.size = size;
array = new Object[size];
}
# These two approaches are not the same:
class Person2
def self.first_name
full_name.split(' ').first
end
private
def self.full_name

Keybase proof

I hereby claim:

  • I am ColbyAley on github.
  • I am colby (https://keybase.io/colby) on keybase.
  • I have a public key whose fingerprint is 8AB6 87E5 6252 9761 B03E 6929 912F 16C0 5F57 4B51

To claim this, I am signing this object:

require 'api_cache'
require 'httparty'
APICache.get('testing', cache: 36000) do
'output goes here!'
end
# This is an example of what a lens may look like.
# It is required by Spectacle when the application is started.
class Twitter < Spectacle::Lens
database do
table do |t|
t.name :tweets
t.text :tweet_content
t.integer :favorites
end
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>ReadIt</title>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
</head>
<body>
<script>
$.ajax({