These are all the JSConf 2014 slides, codes, and notes I was able to cull together from twitter. Thanks to the speakers who posted them and thanks to @chantastic for posting his wonderful notes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Soflomo_View_Helper_Barcode extends Zend_View_Helper_Abstract | |
{ | |
public function barcode ($text, $type = 'code128', $options = array()) | |
{ | |
$options = array('text' => $text) + $options; | |
$resource = Zend_Barcode::draw( | |
$type, 'image', $options, array() | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Executada no bootstrap do módulo | |
* | |
* @param MvcEvent $e | |
*/ | |
public function onBootstrap($e) | |
{ | |
/** @var \Zend\ModuleManager\ModuleManager $moduleManager */ | |
$moduleManager = $e->getApplication()->getServiceManager()->get('modulemanager'); | |
/** @var \Zend\EventManager\SharedEventManager $sharedEvents */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Feedback = Backbone.Model.extend({ | |
url: '/feedback', | |
defaults: { | |
'email': '', | |
'website': '', | |
'feedback': '' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (exports) { | |
var app = exports.app = { | |
bindingContext: { | |
domnode: null, | |
model: null, | |
loadTemplate: function (templateName) { | |
return document.getElementById(templateName).innerHTML; | |
}, | |
bind: function (templateName, vm) { | |
this.domnode.innerHTML = this.loadTemplate(templateName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @constructor | |
*/ | |
function Injector() { | |
/** | |
* @type {!Object.<string, function(Injector=): !Object>} | |
*/ | |
this.factories = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# WARNING: to use "--binary-images hdd", see this bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773833 | |
# WARNING: to get persistence encryption working, apply this fix: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=767195 | |
# Italian locale & keyboard, default boot with luks encrypted persistence | |
lb config --distribution jessie --debian-installer live --binary-images iso-hybrid --archive-areas "main contrib non-free" --bootappend-live "boot=live persistence persistence-encryption=luks locales=it_IT.UTF-8 keyboard-layouts=it username=utente hostname=D8" | |
# English locale & italian keyboard, default boot with luks encrypted persistence | |
#lb config --distribution jessie --debian-installer live --binary-images iso-hybrid --archive-areas "main contrib non-free" --bootappend-live "boot=live persistence persistence-encryption=luks keyboard-layouts=it username=user hostname=D8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUILD_DIR := gen | |
# pandoc is a handy tool for converting between numerous text formats: | |
# http://johnmacfarlane.net/pandoc/installing.html | |
PANDOC := pandoc | |
# pandoc options | |
# Liberation fonts: http://en.wikipedia.org/wiki/Liberation_fonts | |
PANDOC_PDF_OPTS := --toc --chapters --base-header-level=1 --number-sections --template=virsto_doc.tex --variable mainfont="Liberation Serif" --variable sansfont="Liberation Sans" --variable monofont="Liberation Mono" --variable fontsize=12pt --variable documentclass=book | |
PANDOC_EBOOK_OPTS := --toc --epub-stylesheet=epub.css --epub-cover-image=cover.jpg --base-header-level=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# License for any modification to the original (linked below): | |
# ---------------------------------------------------------------------------- | |
# "THE BEER-WARE LICENSE" (Revision 42): | |
# Sebastiano Poggi and Daniele Conti wrote this file. As long as you retain | |
# this notice you can do whatever you want with this stuff. If we meet some day, | |
# and you think this stuff is worth it, you can buy us a beer in return. | |
import argparse, sys, subprocess, tempfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AbilityBuilder, Ability } from 'casl' | |
// Alternatively this data can be retrieved from server | |
export default function defineAbilitiesFor(user) { | |
const { rules, can } = AbilityBuilder.extract() | |
can('read', 'User') | |
can('update', 'User', { id: user.id }) | |
if (user.role === 'doctor') { |
OlderNewer