Skip to content

Instantly share code, notes, and snippets.

View flowck's full-sized avatar
🖊️
probably shipping software.

Firmino Changani flowck

🖊️
probably shipping software.
View GitHub Profile
@flowck
flowck / Example.js
Created November 1, 2014 20:51
[Keystone.js] Use admin forms outside admin #671
// Model
var keystone = require('keystone'),
Types = keystone.Field.Types;
// Set new model
var Example = new keystone.List('Example', {
nocreate: true
});
// Set the fields of your model
@flowck
flowck / HTTP request raw response
Created May 11, 2016 18:17
The raw response from a GET request on OpenWeatherMap Public API
IncomingMessage {
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: null,
@flowck
flowck / server.js
Created October 27, 2016 20:08
File Upload works with http but not with https
var fs = require('fs'),
https = require('https'),
express = require('express'),
app = express(),
multer = require('multer');
var storage = multer.diskStorage({
destination: function(req, file, cb) {
cb(null, '/tmp/');
},
@flowck
flowck / loadMoreUsers.js
Last active July 23, 2017 18:02
A snippet from angolan-on-github project.
// Number of users found
this.totalUsers = data.total_count;
// Pagination is the result of total users found devided by
// the number of users listed per request which is 30
this.pagination = Math.round(data.total_count / 30) + 1;
// Dependências
const express = require('express');
const models = require('./models.js');
const routes = require('./routes.js');
// Iniciar o express
const app = express();
// Iniciar a BD
models.openDB();

Keybase proof

I hereby claim:

  • I am flowck on github.
  • I am flowck (https://keybase.io/flowck) on keybase.
  • I have a public key ASDczJTt-l_ZDYZo2LxuG5uRwFFhUv9_xpux6TFILxQg-Ao

To claim this, I am signing this object:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Vue.js</title>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
</head>
<body>
<script>
const vueapp = new Vue({
el: '#vueapp',
data() {
return {
posts: []
};
},
created() {
const API_POSTS = 'https://jsonplaceholder.typicode.com/posts';
<section id="vueapp">
<article class="post" v-for="post in posts" :key="post.id">
<h1 class="title">{{ post.title }}</h1>
<p>{{ post.body }}</p>
</article>
</section>
<section id="vueapp">
<article
class="post"
v-for="post in posts"
:key="post.id"
v-if="!loading"
>
<h1 class="title">{{ post.title }}</h1>
<p>{{ post.body }}</p>
</article>