Skip to content

Instantly share code, notes, and snippets.

View danielfdsilva's full-sized avatar

Daniel da Silva danielfdsilva

View GitHub Profile
@danielfdsilva
danielfdsilva / README.md
Created March 31, 2022 15:08
🤗 HUG - Human Universal Gridder

🤗 Human Universal Gridder (Hug)

The Human Universal Gridder (Hug) is a layout component with two main purposes:

  1. Create a grid that remains centered on the page and has leading and trailing columns of varying size.
  2. Handle subgrids when a Hug is nested within another Hug.

Human Universal Gridder's grid definition

The image above shows the grid that gets created when a Hug is used. The number of columns varies according to the screen size:

@danielfdsilva
danielfdsilva / fancy-syled.js
Created February 7, 2020 14:53
Fancy styled
import styledComponents, { css } from 'styled-components';
/**
* Disclaimer:
* This code is highly dependent on how styled-components worked at the moment
* this was written. It is likely that any update to the styled-components
* constructor function will break this.
*
* Adapted from https://github.com/styled-components/styled-components/blob/4aa2fdbb3bb890807a5ef361e708870e8d718ec6/packages/styled-components/src/constructors/constructWithOptions.js
*
@danielfdsilva
danielfdsilva / model.yml
Last active January 28, 2020 00:03
Haiti model data structure
# Summary:
# The several cost tables and matrices depend on a series of road properties.
# The breakdown below represents the Mozambique data model and will have to be
# adapted for the Haiti case. Some properties are likely to be replaced and
# others removed
#
# Needed values:
# targetSurfType - Matrix for the resulting surface type after a given improvement is applied.
#
# targetSurfaceCategory - Matrix for the resulting surface status after a given improvement is applied.
@danielfdsilva
danielfdsilva / index.js
Last active August 29, 2015 14:26
DSO blog pagination
DSO.Views = DSO.Views || {};
(function() {
DSO.Views.BlogList = function(opts) {
this.container = opts.container;
var _posts = [];
var _self = this;
var _template = JST['card-list.ejs'];
var _perPage = 9;
@danielfdsilva
danielfdsilva / TwitterStream.php
Last active December 30, 2015 21:29
Scripts used for interaction with the Twitter Stream
<?php
/**
*
* Opens a connection to the twitter stream listening for tweets
* with the given keywords.
* Every time a valid tweet is posted it will be sent to the processTweet()
* method implemented by class extending TwitterStream
*
* @author Mike Pultz (mike@mikepultz.com)
@danielfdsilva
danielfdsilva / Nodecopter-2013-10-04
Created October 4, 2013 17:50
Clone the dronestream repo (https://github.com/bkw/node-dronestream) and replace the code inside example/express/app.js
var express = require('express')
, routes = require('./routes')
, app = express()
, path = require('path')
, server = require("http").createServer(app)
;
app.configure(function () {
app.set('views', __dirname + '/views');