Skip to content

Instantly share code, notes, and snippets.

View dbachet's full-sized avatar

Damien Bachet dbachet

View GitHub Profile
@dbachet
dbachet / something.js.coffee
Last active December 16, 2015 21:39
Stop default page scroll down if key down was pressed. /!\ Not working....
$(document).keyup (e) =>
switch e.which
# key down
when 40
e.preventDefault()
@dbachet
dbachet / controllers-links-new.js
Created October 14, 2014 05:40
Add new created item to the list not refresh the list properly
@dbachet
dbachet / gist:3bfcc9476278b5fcadf9
Created January 28, 2015 10:02
Nice box shadows (give "bloc curve" class to the box you want) - for fixed height
.bloc {
position: relative;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
display: inline-block;
vertical-align: top;
background: white;
@dbachet
dbachet / bench.rb
Created March 2, 2016 18:26
Benchmark #flat_map() and flatten.map() in different ruby versions
require 'benchmark/ips'
def flatmap
[[1,2],[3,4]].flat_map {|i| i }
end
def flatten_then_map
[[1,2],[3,4]].flatten.map {|i| i }
end
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
options: {}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
options: {}
});
import Component from '@ember/component';
export default Component.extend({
tagName: 'div',
classNames: ['yay-class']
});
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
export default class extends Component {
@tracked _state = false;
// get externalState (){
// return this.args.isCheckboxSelected(this.args.checkcboxOwnerId, this.args.selectedCheckboxes)
// }
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
@tracked allOpen = false;
@action toggleAll(state) {
this.allOpen = state;
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
@tracked allOpen = false;
@action toggleAll(state) {
this.allOpen = state;