Skip to content

Instantly share code, notes, and snippets.

@superlou
superlou / action-bar.hbs
Last active August 6, 2016 19:46 — forked from anonymous/action-bar.hbs
Bad Heirarchies
<div class='action-bar'>
{{input}}
<ul class='actions'>
<li>Save<span class='shortcut'>ctrl + s</span></li>
<li>Insert timestamp<span class='shortcut'>ctrl + d</span></li>
<li>Close task</li>
<li>Reject task</li>
<li>Insert new task</li>
<li>Hide completed</li>
<li>Collapse all</li>
@superlou
superlou / dial.json
Created February 24, 2016 13:58
kag0's dial
{
"diameter": 28.5,
"dial_fill": "#000",
"default_fill": "#fff",
"rings": [
{
"features": [
{
"type": "radial",
"diameter": 23,
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['schedule-grid'],
@superlou
superlou / schedule-grid.hbs
Created January 11, 2016 00:41
ember-sortable weirdness
{{#sortable-group tagName="div" onChange="reorderPlaces" as |group|}}
{{#each placesSorted as |place|}}
{{#sortable-item tagName="div" model=place group=group class='reservable'}}
{{place.name}}
{{/sortable-item}}
{{/each}}
{{/sortable-group}}
#!/bin/sh
chown www-data:www-data .
chown -R www-data:www-data *
find . -type f -not -name "fix-permissions.sh" | xargs chmod 664
find ./bin -type f | xargs chmod 775
find . -type d | xargs chmod 775
find . -type d | xargs chmod +s
umask 0002
def rotate_vector_cython_fast(np.ndarray[np.float64_t, ndim=1] vector,
np.ndarray[np.float64_t, ndim=1] axis,
float angle):
"""
Uses Rodrigues rotation formula
axis must be a normal vector
Implements:
v_rot = (v * np.cos(angle) + np.cross(k, v) * np.sin(angle) +
k * (np.dot(k, v)) * (1 - np.cos(angle)))
@superlou
superlou / schedule.js
Created April 27, 2015 23:34
Odd time conversions
import DS from 'ember-data';
export default DS.Model.extend({
name: DS.attr('string'),
start: DS.attr('date'),
finish: DS.attr('date'),
places: DS.hasMany('places'),
events: DS.hasMany('event')
});
@superlou
superlou / online-store.js
Created April 8, 2015 23:53
Dropbox Store
var DropboxOnlineAdapter = DS.Adapter.extend({
find: function(store, type, id, snapshot) {
var dropbox = this.container.lookup('service:dropbox');
var path = this.filename(type, id);
return dropbox.files(path).then((result) => {
var data = {
id: id,
text: result
import Ember from 'ember';
var gDrive = Ember.Object.extend({
clientId: '937974467154-23re9rr70mnlkmuddvpp325abth5u51k.apps.googleusercontent.com',
scopes: ['https://www.googleapis.com/auth/drive', 'email'],
authed: false,
ready: false,
init: function() {
window.handleClientLoad = this.handleClientLoad.bind(this);
import ApplicationAdapter from './application';
export default ApplicationAdapter.extend({
findAll: function(store, type, sinceToken) {
return new Promise(function(resolve, reject) {
$.post('http://localhost/wsibd/tasks.php', {
file: '/home/lsimons/workspace/wsibd/test_files/test.mpp',
resourceName: 'LCS'
}, function(result) {