Skip to content

Instantly share code, notes, and snippets.

View bas080's full-sized avatar

#!/bin/BasH bas080

View GitHub Profile
@bas080
bas080 / gist:1f6086252e73e4969a57
Created June 4, 2014 20:11
minetest particle spawner (spawns but does not move)
100 minetest.add_particle({
101 pos = {x=pos.x, y=pos.y+1, z=pos.z},
102 velocity = {x=10 ,y=2,z=5},
103 acceleration = {x=10,y=-0.5,z=0},
104 expirationtime = 2,
105 size = 1,
106 collisiondetection = true,
107 texture = 'bees_wax.png',
108 })
@bas080
bas080 / columnice.py
Created February 6, 2015 09:33
Easily columize code. Example would be "columnice.py ,". This will columize the text using the comma ',' as the delimeter.
#!/usr/bin/env python
import sys
def matrix( text, seperator_x='\t', seperator_y='\n'):
table = []
rows = text.split( seperator_y )
for index, row in enumerate( rows ):
table.insert( index, row.split( seperator_x ) )
return table
@bas080
bas080 / gist:5351800
Created April 10, 2013 04:30
Error lua
06:29:42: ERROR[main]: ========== ERROR FROM LUA ===========
06:29:42: ERROR[main]: Failed to load and run script from
06:29:42: ERROR[main]: /home/bas/Games/minetest/bin/../games/minimal/mods/1x1textureresizer/init.lua:
06:29:42: ERROR[main]: ...bin/../games/minimal/mods/1x1textureresizer/init.lua:33: bad argument #1 to 'output' (/home/bas/Games/minetest/bin/../games/minimal/mods/1x1textureresizer/textures/default_tnt_side_4x4.png: No such file or directory)
06:29:42: ERROR[main]: stack traceback:
06:29:42: ERROR[main]: [C]: in function 'output'
06:29:42: ERROR[main]: ...bin/../games/minimal/mods/1x1textureresizer/init.lua:33: in function 'filecopy'
06:29:42: ERROR[main]: ...bin/../games/minimal/mods/1x1textureresizer/init.lua:134: in main chunk
(defn throw-die [] (inc (rand-int 6)))
(defn throw-dice [] (repeatedly throw-die))
(defn yahtzee? [numbers] (apply = numbers))
(defn printlnrt [v] (do (println v) v))
(defn throw-yahtzee [] (while (not (yahtzee? (printlnrt (take 14 (throw-dice)))))))
(ns lor.core
(:gen-class))
(require '[clojure.java.io :as io]
'[clojure.string :as string])
(defn user-home
"get the user home directory"
[]
(System/getProperty (str "user.home")))

Usabilla challenge

Validate HTML

Before starting I validate the HTML. The HTML is valid, meaning that it does not have syntax errors. After completing tasks I then re-validate the HTML to verify that no errors were introduced.

Theme

var _ = require('ramda');
_.exists = exists;
_.args = args;
_.ap = ap;
_.Either = Either;
_.Either.either = _.curry(either);
<form>
<!-- does nothin more then create a fieldset, add legend and nest elements
within it -->
<form-fieldset title="Hello World">
<!-- already got this working still needs a config -->
<form-entity-generated entity="someEntity"></form-entity-generated>
<!-- only show a specific set of properties -->>
class FormElementGeneratedCustomElement {
@bindable entity;
@bindable property;
constructor(config) => {
this.entity = config.entityStrategy(this.entity);
this.validations = [];
@bas080
bas080 / app.html
Created June 22, 2016 10:49 — forked from jdanyow/app.html
Aurelia Validation Demo
<template>
<require from="./registration-form"></require>
<registration-form></registration-form>
</template>