Skip to content

Instantly share code, notes, and snippets.

Building @code-hike

Rodrigo Pombo pomber

Building @code-hike
View GitHub Profile
pomber / ko.animated-css.js
Created February 22, 2013 20:59
knockout animation on class change
View ko.animated-css.js
var classesWrittenByBindingKey = '__ko__cssValue';
ko.bindingHandlers.animatedCss = {
'update': function (element, valueAccessor) {
var value = ko.utils.unwrapObservable(valueAccessor());
if (typeof value == "object") {
var currentClassList = element.className.split(/\s+/);
var removeClassList = [];
var addClassList = [];
pomber / index.html
Last active February 28, 2016 00:36
From Zero to Polymer: Step 01 - document.registerElement
View index.html
<!DOCTYPE html>
<html lang="en">
var MyElementProto = Object.create(HTMLElement.prototype);
pomber / index.html
Created February 28, 2016 00:54
From Zero to Polymer: Step 02 - template
View index.html
<!DOCTYPE html>
<html lang="en">
<template id="my-element-template">
<p>My <b>custom element</b> markup!</p>
pomber / index.html
Last active February 28, 2016 02:31
From Zero to Polymer: Step 03 - HTML import
View index.html
<!DOCTYPE html>
<html lang="en">
<link rel="import" href="my-element.html">
View Install Visual Studio Code on Linux
curl -L > /tmp/
unzip -qq /tmp/ -d /tmp
sudo cp -r /tmp/VSCode-linux-x64 /opt/vscode
sudo ln -s /opt/vscode/code /usr/local/bin/vscode
sudo rm -rf /tmp/VSCode-linux-x64
sudo rm -f /tmp/
sudo touch /usr/share/applications/vscode.desktop
sudo chmod 777 /usr/share/applications/vscode.desktop
sudo echo -e "[Desktop Entry]\nName=VSCode\nComment=Visual Studio Code\nExec=/opt/vscode/code\nIcon=/opt/vscode/resources/app/resources/linux/code.png\nType=Application\nVersion=1.0\nTerminal=false\nCategories=Development" > /usr/share/applications/vscode.desktop
sudo chmod 644 /usr/share/applications/vscode.desktop
pomber / package.json
Created March 14, 2017 22:44
Root package.json with nested scripts
View package.json
"stuff": "...",
"scripts": {
"postinstall": "run-p install:api install:web",
"install:api": "cd api && npm install",
"install:web": "cd web && npm install",
"start": "run-p start:api start:web",
"start:api": "npm run start --prefix api",
"start:web": "npm run start --prefix web",
pomber / node.dockerfile
Created March 30, 2017 13:49
Node Dockerfile
View node.dockerfile
FROM node:alpine
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY server/dist /usr/src/app
CMD [ "node", "server.js" ]
pomber / nginx.dockerfile
Created March 30, 2017 14:04
NGINX Dockerfile
View nginx.dockerfile
FROM nginx:alpine
COPY web/build /usr/share/nginx/html
COPY docker/nginx.node.conf /etc/nginx/conf.d/default.conf
pomber / nginx.node.conf
Created March 30, 2017 14:06
NGINX conf
View nginx.node.conf
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
location /api/ {
pomber / .travis.yml
Created March 30, 2017 15:30
Basic node Travis config
View .travis.yml
sudo: false
language: node_js
- "node"
yarn: true
before_install: npm install yarn -g
- npm test
- npm run build