Skip to content

Instantly share code, notes, and snippets.

View raedatoui's full-sized avatar

Raed Atoui raedatoui

View GitHub Profile
@raedatoui
raedatoui / Cypher Load CSV
Last active April 18, 2019 19:19 — forked from nlovett/orchard-sme-hackathon-neo4j-cohort-notes.md
orchard/sonymusic neo4j hackathon
USING PERIODIC COMMIT 10000
LOAD CSV WITH HEADERS FROM 'file:///Tracks.csv' as line
WITH line,
CASE
WHEN toFloat(line.TEMPO) < 20 THEN "Larghissimo"
WHEN toFloat(line.TEMPO) >= 20 AND toFloat(line.TEMPO) < 40 THEN "Grave"
WHEN toFloat(line.TEMPO) >= 40 AND toFloat(line.TEMPO) < 60 THEN "Largo"
WHEN toFloat(line.TEMPO) >= 60 AND toFloat(line.TEMPO) < 80 THEN "Adagio"
WHEN toFloat(line.TEMPO) >= 80 AND toFloat(line.TEMPO) < 120 THEN "Moderato"
WHEN toFloat(line.TEMPO) >= 120 AND toFloat(line.TEMPO) < 180 THEN "Allegro"
@raedatoui
raedatoui / ripple.frag
Created August 14, 2016 23:55 — forked from alco/ripple.frag
Ripple effect for GLSL
// simple fragment shader
// 'time' contains seconds since the program was linked.
uniform float time;
uniform sampler2D tex;
uniform sampler2D tex2;
float radius = .5;
@raedatoui
raedatoui / activeadmin_sortable.js.coffee
Last active August 29, 2015 14:05 — forked from robertjwhitney/activeadmin_sortable.js.coffee
Same concept, and make the collection_action return HTML markup to reflect the newly sorted items. Requires Nokogiri for parsing the html
# http://stackoverflow.com/a/8936202
#
# ActiveAdmin already includes the necessary jquery in active_admin/base,
# so just add this to javascripts/active_admin.js after //= require active_admin/base
#
#
# Serialize and Sort
#
# model_name - you guessed it, the name of the model we are calling sort on.
# This is the actual variable name, no need to change it.