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
@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;
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(); }]); })();
javascript:(function() {
var timeToDisplayNotifInSeconds = 5;
var notificationRegistrar = function(){
var notify = function(message, callback) {
var notification = new Notification(message);
callback(notification);
};
@cha0s
cha0s / gist:cc46894e3f1704812f66
Created February 12, 2015 21:54
Reddichat notifications (thanks milcom!)
javascript:(function() { var timeToDisplayNotifInSeconds = 5;var notificationRegistrar = function(){var notify = function(message, callback) {var notification = new Notification(message); callback(notification);};angular.element(document.body).injector().invoke(['$rootScope', 'shrub-socket', 'shrub-ui/notifications', 'shrub-user', function($rootScope, socket, notifications, user) { if (window.notifyMentions) { window.notifyMentions = false; notifications.add({text: 'Notifications for mentions disabled.'}); } else { window.notifyMentions = true; socket.on('reddichat.chat.message', function(message) {if(message.text.search(user.instance().name) > -1) {notify(message. from + ": " + message.text, function(notification){setTimeout(function(){notification.close();}, timeToDisplayNotifInSeconds * 1000);});} }); notifications.add({text: 'Notifications for mentions enabled.'}); } $rootScope.$digest(); }]);};var registerNotificationsIfPermitted = function(c
From 7e9c16806638ca413025defc91185c8f2ea471a6 Mon Sep 17 00:00:00 2001
From: Ruben Rodriguez <cha0s@therealcha0s.net>
Date: Wed, 23 Jun 2010 07:00:06 -0500
Subject: [PATCH] Added Script.createContext() and Script.runInContext() and implemented it in the REPL.
---
lib/repl.js | 40 ++++++++--------
src/node.cc | 7 ++-
src/node_cares.cc | 8 ++--
src/node_child_process.cc | 2 +-

Reddichat - Markdown - Expando - Image - Resizer

path = require 'path'

exports.pkgmanRegister = (registrar) ->

  registrar.registerHook 'shrubAngularDirective', -> [
    '$compile', '$window'
    ($compile, $window) ->
@cha0s
cha0s / WB-content-dev.md
Created June 3, 2012 07:44
Instructions for cloning and managing the WB content folder
$ sudo npm install -g npm
npm http GET https://registry.npmjs.org/npm
npm http 200 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/-/npm-1.1.24.tgz
npm http 404 https://registry.npmjs.org/npm/-/npm-1.1.24.tgz
npm ERR! Error: shasum check failed for /tmp/npm-1338882388006/1338882388006-0.6075703264214098/tmp.tgz
npm ERR! Expected: e7523bb997bd4af19a95f02848e805ab9820c442
npm ERR! Actual: c9de0f9499b0a8db7475a87b0586fe0b83472313
npm ERR! at /usr/local/lib/node_modules/npm/lib/utils/sha.js:25:20
@cha0s
cha0s / gist:2946163
Created June 18, 2012 00:29
TexTy UI 2.0
# jQuery.
$ = jQuery
# The slot where the next guessed letter will fall.
guessSlot = 0
# The prefix necessary to keep the letter lists centered.
prefix = 2
# Triggered when a guess is submitted.
@cha0s
cha0s / gist:2975596
Created June 22, 2012 22:43
mmm, coffee
app.register(
'.html'
compile: (source, options) ->
if typeof source isnt 'string' then source else
(options) ->
mustache.to_html(
source