Skip to content

Instantly share code, notes, and snippets.

View cha0s's full-sized avatar
👌
Gettin' it

Ruben R cha0s

👌
Gettin' it
View GitHub Profile
javascript:(function() { angular.element(document.body).injector().invoke(['$rootScope', 'shrub-socket', 'shrub-ui/notifications', function($rootScope, socket, notifications) { if (window.playMessageSound) { window.playMessageSound = false; notifications.add({text: 'Message sound disabled'}); } else { window.playMessageSound = true; if (!window.messageSound) { window.messageSound = document.createElement('audio'); window.messageSound.src = 'http://reddichat.com/chat-message.mp3'; socket.on('reddichat.chat.message', function() { if (window.playMessageSound) window.messageSound.play(); }); } notifications.add({text: 'Message sound enabled'}); } $rootScope.$digest(); }]); })();
@cha0s
cha0s / gist:cf07a59f689101d8298f
Last active August 29, 2015 14:15
Reddichat sound hax :3
angular.element(document.body).injector().invoke(['$rootScope', 'shrub-socket', 'shrub-ui/notifications', function($rootScope, socket, notifications) {
if (window.playMessageSound) {
window.playMessageSound = false;
notifications.add({text: 'Message sound disabled'});
}
else {
window.playMessageSound = true;
$module.service 'title', [
'$timeout'
($timeout) ->
# Certain things will want to make the window/tab title flash for attention.
# Those things will use this API to do so.
_flashUpWrapper = (text) -> "¯¯¯#{text.toUpperCase()}¯¯¯"
_flashDownWrapper = (text) -> "___#{text}___"
// Requires ember.js and ember-data.js, socket.io
// Initializer for Models
window.Models = {};
var SOCKET = '/'; // Served off the root of our app
var ID = 'uuid';
var FIND = 'find';
var FIND_MANY = 'findMany';
@cha0s
cha0s / gist:3812609
Created October 1, 2012 15:47
Avocado Initial State example
# Avocado loads the 'Initial' state, and from there it's all up to you!
avo.States['Initial'] = new class
# Called the first time this state is loaded. You can set up any stuff your
# state needs here.
constructor: ->
# Yum, an avocado!
@avocado = {}
@cha0s
cha0s / gist:3811739
Created October 1, 2012 13:17
Avocado example State
# Avocado loads the 'Initial' state, and from there it's all up to you!
avo.States['Initial'] = new class
# Called the first time this state is loaded. You can set up any stuff your
# state needs here.
constructor: ->
# Yum, an avocado!
@avocado = {}
main = new MainBrowser()
main.initialize().then ->
Engine.state =
state: 'Environment'
args:
teleport:
environment: '/environment/browser-demo-kstown.environment.json'
roomIndex: 0
Warning: array_keys() expects parameter 1 to be array, null given in drupal_schema_fields_sql() (line 6880 of /home/cha0s6983/dev/web/5ringsweb.com/esrc_etdb/public_html/includes/common.inc).
Warning: Invalid argument supplied for foreach() in entity_metadata_convert_schema() (line 151 of /home/cha0s6983/dev/web/5ringsweb.com/esrc_etdb/public_html/sites/all/modules/entity/entity.info.inc).
Warning: in_array() expects parameter 2 to be array, null given in _entity_defaults_rebuild() (line 651 of /home/cha0s6983/dev/web/5ringsweb.com/esrc_etdb/public_html/sites/all/modules/entity/entity.module).
User warning: Missing database columns for the exportable entity rules_config as defined by entity_exportable_schema_fields(). Update the according module and run update.php! in _entity_defaults_rebuild() (line 652 of /home/cha0s6983/dev/web/5ringsweb.com/esrc_etdb/public_html/sites/all/modules/entity/entity.module).
{
"traits": [
{
"type": "Existence"
},
{
"type": "Interactive",
"state": {
"rule": {
"name": "Interaction rule",
{
"uri": "/entity/npc/inside_npc1.entity.json",
"traits": [
{
"type": "Existence",
"state": {
"x": 256,
"y": 96
}
},