Skip to content

Instantly share code, notes, and snippets.

@jaen
jaen / gist:3926212
Created October 21, 2012 07:10
Stylus support for Middleman
require "stylus"
module Middleman
module Renderers
# Sass renderer
module Stylus
# Setup extension
class << self
# Once registered
def registered(app)
@jaen
jaen / gist:3863583
Created October 10, 2012 06:56
UJS problem
# _share.html.haml button
= form_tag(public_memo_path(@memo), :remote => true, :style => 'margin-bottom: 5px;') do
= submit_tag "Make #{@memo.public? ? 'private' : 'public'}", :id => "make_public_button", :class=>"simple #{@memo.public? ? 'redish' : 'blue'} floatright", :disable_with => "Changing status..."
# memo_controller.rb, public action
def public
@memo = Memo.find(params[:id])
authorize! :share, @memo
#ifndef LINKEDTABLE_H_INCLUDED
#define LINKEDTABLE_H_INCLUDED
//--- includes
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#ifdef HAS_OGL
#include <GL\glew.h>
''=~( '(?{' .('`' |'%') .('[' ^'-')
.('`' |'!') .('`' |',') .'"'. '\\$'
.'==' .('[' ^'+') .('`' |'/') .('['
^'+') .'||' .(';' &'=') .(';' &'=')
.';-' .'-'. '\\$' .'=;' .('[' ^'(')
.('[' ^'.') .('`' |'"') .('!' ^'+')
.'_\\{' .'(\\$' .';=('. '\\$=|' ."\|".( '`'^'.'
).(('`')| '/').').' .'\\"'.+( '{'^'['). ('`'|'"') .('`'|'/'
).('['^'/') .('['^'/'). ('`'|',').( '`'|('%')). '\\".\\"'.( '['^('(')).
'\\"'.('['^ '#').'!!--' .'\\$=.\\"' .('{'^'['). ('`'|'/').( '`'|"\&").(
(defn synchronise-folders [{:keys [user] :as opts}]
(let [result-chan (chan)
owner-id (:id user)]
(go (log/log "request about to be sent")
(logic/dispatch-event [:api :folders :get] {:params {:owner owner-id} :result-chan result-chan})
(let [result (<! result-chan)]
(log/log "result came back:" result)
(match result
[:success {:list folders}] (update-db-entities (map prepare-folder folders))
[:error new-errors] nil)))))
╭─jaen@himitsu ~/projects/mediApp ‹2.2.0› ‹master*›
╰─$ grails run-app
| Running Grails application
Configuring Spring Security Core ...
... finished configuring Spring Security Core
Configuring Spring Security REST ...
... finished configuring Spring Security REST
2015-04-13 09:16 -- ERROR-org.hibernate.tool.hbm2ddl.SchemaExport:HHH000389: Unsuccessful: alter table device drop constraint FK_pcy81225bwhco6jbog85ysx0k
2015-04-13 09:16 -- ERROR-org.hibernate.tool.hbm2ddl.SchemaExport:ERROR: relation "device" does not exist
2015-04-13 09:16 -- ERROR-org.hibernate.tool.hbm2ddl.SchemaExport:HHH000389: Unsuccessful: alter table employee_specialization drop constraint FK_a837a22vdkyxqih1o0y5dv954
void Draw (void)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer
glLoadIdentity (); // Reset The Modelview Matrix
// Get FPS
if( GetTickCount() - g_dwLastFPS >= 1000 ) // When A Second Has Passed...
{
g_dwLastFPS = GetTickCount(); // Update Our Time Variable
g_nFPS = g_nFrames; // Save The FPS
#!/bin/sh
WPS_LED="/sys/devices/platform/leds-gpio/leds/netgear:green:wps/trigger"
if [ "$ACTION" = "pressed" -a "$BUTTON" = "wps" ]; then
logger "WPS button pressed, looking for active radios"
for dir in /var/run/hostapd*; do
[ -d "$dir" ] || continue
hostapd_cli -p "$dir" wps_pbc && \
echo "timer" > $WPS_LED
done
while true ; do
@jaen
jaen / ruby-2.1.0-github
Created April 24, 2014 08:22
ruby-2.1.0-github
install_package "yaml-0.1.6" "http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz#5fe00cda18ca5daeb43762b80c38e06e" --if needs_yaml
install_package "openssl-1.0.1g" "https://www.openssl.org/source/openssl-1.0.1g.tar.gz#de62b43dfcd858e66a74bee1c834e959" mac_openssl --if has_broken_mac_openssl
install_git "ruby-2.1.0-github" "https://github.com/github/ruby.git" "2.1" ldflags_dirs autoconf standard verify_openssl
install_package "yaml-0.1.6" "http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz#5fe00cda18ca5daeb43762b80c38e06e" --if needs_yaml
install_package "openssl-1.0.1g" "https://www.openssl.org/source/openssl-1.0.1g.tar.gz#de62b43dfcd858e66a74bee1c834e959" mac_openssl --if has_broken_mac_openssl
install_git "ruby-2.1.0-github" "https://github.com/github/ruby.git" "2.1" ldflags_dirs autoconf standard verify_openssl