Skip to content

Instantly share code, notes, and snippets.

View blissdev's full-sized avatar

Jordan Arentsen blissdev

View GitHub Profile
CREATE OR REPLACE FUNCTION public.rotate()
RETURNS boolean
LANGUAGE plv8
AS $function$
var toDegrees = function toDegrees (angle) {
return angle * (180 / Math.PI);
}
var rooms = plv8.execute(
javascript:(function(){var%20visibleTags=$('span.tag:visible');visibleTags.each(function(){var%20tag=$(this);var%20position=tag.position();var%20left=tag.position().left;tag.css({right:'auto',left:left,background:'red',cursor:'pointer'});});visibleTags.draggable({stop:function(e,ui){var%20pos=ui.helper.position();var%20update={id:ui.helper.data('room'),tagXPosition:576-pos.left-ui.helper.outerWidth()-2,tagYPosition:ui.helper.css('top').slice(0,-2)};console.log(update);$.ajax({url:'/d/room/update_batch',type:'post',data:{updates:JSON.stringify([update])}})}});})();
@blissdev
blissdev / gist:ead0982d6009cf6eb9d9
Created July 11, 2014 05:10
light command error after running `light server.js`
readlink: illegal option -- f
usage: readlink [-n] [file ...]
usage: dirname path
2014-07-11 00:08:12.366 node-webkit[20895:507] Internals of CFAllocator not known; out-of-memory failures via CFAllocator will not result in termination. http://crbug.com/45650
LSOpenURLsWithRole() failed for the application /Applications/LightTable/LightTable.app with error -600.
@blissdev
blissdev / error.txt
Created August 26, 2014 02:36
omelette `lein demo` error
Web server running on port 62635
Mon Aug 25 21:29:46 CDT 2014 [worker-1] ERROR - GET /
javax.script.ScriptException: TypeError: Cannot get property "value" of null in <eval> at line number 52121
at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:586)
at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:511)
at jdk.nashorn.api.scripting.NashornScriptEngine.invokeMethod(NashornScriptEngine.java:236)
at omelette.render$render_fn_STAR_$render_to_string__11629.invoke(render.clj:21)
at omelette.render$render_fn_STAR_$render__11631.invoke(render.clj:38)
at omelette.render$render_fn$render__11670.invoke(render.clj:55)
at omelette.route$wildcard_ring_route$fn__11733.invoke(route.clj:163)
@blissdev
blissdev / client-id-gen.php
Created October 27, 2014 21:51
Client ID Generator
echo substr(hash('sha256', time()), 0, 32);
(let [c (om/get-props owner)
v (deref c)]
(log v))
; Uncaught Error: Cannot manipulate cursor outside of render phase, only om.core/transact!, om.core/update!, and cljs.core/deref operations allowed
; from line 2
function (meta,cnt,arr,__hash){
this.meta = meta;
this.cnt = cnt;
this.arr = arr;
this.__hash = __hash;
this.cljs$lang$protocol_mask$partition0$ = 16647951;
this.cljs$lang$protocol_mask$partition1$ = 8196;
}
(defn subscribe-to-match [owner match-id]
(let [pusher (om/get-shared owner :pusher)
previous-channel (om/get-state owner :match-pusher-chan)
new-channel (.subscribe pusher (str "match-" match-id))
events-chan (om/get-shared owner :match-events-chan)
events-list ["draft_character" "begin" "update_score"
"set_turn_number" "add_target" "remove_target"
"change_round" "change_turn" "update_health"]]
(when previous-channel (.unbind previous-channel))
(doseq [event-name events-list]
@blissdev
blissdev / error.txt
Last active August 29, 2015 14:12
transit-js writer issue
{ [Error: Cannot write ]
data: { obj: { property_id: 25, label: 'Age', key: 'age' }, type: '' },
domain:
{ domain: null,
_events: { error: [Function] },
_maxListeners: 10,
members: [] },
domainThrown: true }
Error: Cannot write
===========================================================================
The following directories are used by znc-1.0 and
have the wrong ownership and/or permissions:
/opt/local/etc/znc (m=755, o=root, g=root)
===========================================================================
===========================================================================
$NetBSD$