Skip to content

Instantly share code, notes, and snippets.

View raphaelbadia's full-sized avatar
😄

Raphaël Badia raphaelbadia

😄
View GitHub Profile
  • test
  • done
  • change the class="night_image" in header_user.html
  • a task list item
  • list syntax required
  • normal formatting, @mentions, #1234 refs
  • incomplete
  • completed

Vue Cheat Sheet

Basic Vue structure

{{ var }} displays an escaped string.

<div class="app">
	<p>{{ title }}</p>
	<p>{{ sayHello() }}</p>
	<p><a href="{{ link }}">This link is not working: Vuejs cannot bind it.</a></p>
.platform-browser {
display: flex;
justify-content: center;
.hello-browser {
background-color: red;
}
}
<link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
@raphaelbadia
raphaelbadia / transform.ts
Created October 23, 2017 12:27
transform php-api returned json to classes
class Mother {
protected toInt = []
protected toBool = []
protected toObject = []
deserialize(instanceData) {
console.log('mother deserializing ')
const keys = Object.keys(this);
for (const key of keys) {
@raphaelbadia
raphaelbadia / docker_setup.sh
Last active June 1, 2018 11:14
install docker in goinfre
#!/bin/sh
# sh docker_setup.sh
# from https://gist.github.com/gcamerli/b8cf836f8627cb285f33086db10096a2
# Assuming you’re using zsh and you’ve already installed
# VirtualBox from MSC
LOGIN=$(whoami)
rm -rf ~/.docker
@raphaelbadia
raphaelbadia / node_nginx_ssl.md
Created April 25, 2020 05:51 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

const mainMachine = Machine({
id: 'main',
initial: 'idle',
context: {
// retries: 0
},
states: {
idle: {
on: {
@raphaelbadia
raphaelbadia / machine.js
Created January 23, 2021 20:52
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@raphaelbadia
raphaelbadia / machine.js
Last active January 23, 2021 21:28
Generated by XState Viz: https://xstate.js.org/viz
const fetchRandomDog = () => null
const specialitySelectMachine = Machine({
id: "dog fetcher",
initial: "loading",
context: {
dog: null,
error: null
},
states: {