Skip to content

Instantly share code, notes, and snippets.

View karellm's full-sized avatar
🌴
On vacation

Karel Ledru karellm

🌴
On vacation
View GitHub Profile
import Model from "ember-data/model";
import attr from "ember-data/attr";
import { belongsTo, hasMany } from "ember-data/relationships";
export default Model.extend({
worksOk: DS.attr('boolean'),
doesNotWorks: DS.attr('boolean', { defaultValue: false })
});
import Adapter from "ember-data/adapters/json-api";
export default Adapter.extend();
@karellm
karellm / adapters.application.js
Last active February 8, 2017 20:47
Relationships
import Adapter from "ember-data/adapters/json-api";
export default Adapter.extend();
@karellm
karellm / The truth.js
Created March 5, 2016 21:46
The only right way!
gulp.task(
'build-jsx',
() => {
return (
browserify({
entries: './client/index.js',
debug: true,
})
.transform(babelify.configure({
presets: ['es2015', 'react']
# DOCKER
# ======
if hash docker 2>/dev/null; then
alias dk="docker"
fi
dsa () {
docker stop $(docker ps -a -q)
}
= form_for(@visualization) do |f|
= f.input :title
= f.fields_for :inputs_visualizations do |iv|
= iv.input :color
= iv.fields_for :input do |i|
= i.input :title
<form accept-charset="UTF-8" action="/companies/12" class="l-inline" data-remote="true" method="post" novalidate="novalidate">
<div class="fields">
<div class="row">
<!-- Here goes the input -->
</div>
</div>
</form>
@karellm
karellm / start.sh
Last active December 24, 2015 11:09
Wordpress bootstrap script
#!/bin/bash
# 1/ HERE I WANT MY WP-CONFIG.PHP TO BE OVERWRITTEN IF IT EXISTS,
# SO I CHANGED THE TEST FOR THE PWD FILE
if [ ! -f /mysql-root-pw.txt ]; then
#let's create a user to ssh into
SSH_USERPASS=`pwgen -c -n -1 8`
mkdir /home/user
useradd -G sudo -d /home/user user
@karellm
karellm / gist:6651723
Last active December 23, 2015 14:49
Meteor Dockerfile
FROM ubuntu
RUN apt-get install -y openssl vim tmux git-core curl
RUN apt-get install -y python-software-properties python
RUN add-apt-repository ppa:chris-lea/node.js
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade
RUN apt-get install -y nodejs
RUN curl https://install.meteor.com | /bin/sh -x
@karellm
karellm / README
Created November 7, 2012 23:41
Meta box definition
The first is my definition. As you can note, there is a 'templates' argument. The problem was there before I added this.
I added what I changed to the inc/classes/meta-box.php to make the metabox definition check for the template used. It is very useful to have metabox on some pages only.