Skip to content

Instantly share code, notes, and snippets.

View brynner's full-sized avatar
😎
Hello World!

Brynner Ferreira brynner

😎
Hello World!
View GitHub Profile
@brynner
brynner / dev.to.yaml
Created August 25, 2021 13:34 — forked from cor-bee/dev.to.yaml
Overdocumented Instant View Template for dev.to (https://instantview.telegram.org/contest/dev.to/template28/)
## General info:
# Function starts with @
# Variable starts with $
# Return of the most recently run function made by $@
# Key comments marked with ##
## Version of IV must be set first
~version: "2.1"
# Telegram doesn't support JW Player which is used in videoheaders
@brynner
brynner / xmlToJson.js
Created October 15, 2018 13:19 — forked from chinchang/xmlToJson.js
Function to convert XML to JSON
// Changes XML to JSON
// Modified version from here: http://davidwalsh.name/convert-xml-json
function xmlToJson(xml) {
// Create the return object
var obj = {};
if (xml.nodeType == 1) { // element
// do attributes
if (xml.attributes.length > 0) {
@brynner
brynner / index.jsx
Created September 27, 2018 14:22 — forked from avinmathew/index.jsx
Multiple layouts with React Router v4
import React from "react"
import { Route, Switch } from "react-router-dom"
const AppRoute = ({ component: Component, layout: Layout, ...rest }) => (
<Route {...rest} render={props => (
<Layout>
<Component {...props} />
</Layout>
)} />
)
@brynner
brynner / file.html
Last active September 5, 2018 15:40
Using i18n in JavaScript
<div id="result">...</div>
@brynner
brynner / getProperty.js
Last active September 5, 2018 13:53 — forked from jasonrhodes/getProperty.js
Get a nested object property by passing a dot notation string as the property name
/**
* A function to take a string written in dot notation style, and use it to
* find a nested object property inside of an object.
*
* Useful in a plugin or module that accepts a JSON array of objects, but
* you want to let the user specify where to find various bits of data
* inside of each custom object instead of forcing a standardized
* property list.
*
* @param String nested A dot notation style parameter reference (ie "urls.small")
@brynner
brynner / Admin.cshtml
Created August 23, 2018 22:42
C# - Rendering different Partials and Scripts according to a statement using Razor.
I'm an admin.
@brynner
brynner / dom.js
Last active August 16, 2018 15:43
Add data to HTML according to object's property name
// Add data to HTML according to object´s property name
function addContentFromDataToHtml(object, dataSet) {
recursiveObject({object: object, callback: addContentFromDataToHtmlCallback, dataSet: dataSet});
}
function recursiveObject(recursiveParams) {
if (recursiveParams.parentsItem) {
recursiveParams.parentsItem = recursiveParams.parentsItem+'.';
} else {
recursiveParams.parentsItem = '';
}
@brynner
brynner / Dockerfile
Created September 19, 2017 02:56 — forked from MichaelCaraccio/Dockerfile
PHP7 + Apache + Laravel + Amazon web services (AWS) Elastic Beanstalk
FROM php:7.0.12-apache
ENV DEBIAN_FRONTEND=noninteractive
# Install the PHP extensions I need for my personnal project (gd, mbstring, opcache)
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libpq-dev git mysql-client-5.5 wget \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd mbstring opcache pdo zip
@brynner
brynner / bootstrap-mq.scss
Last active June 29, 2017 18:44 — forked from olegpolyakov/bootstrap-mq.scss
Bootstrap Sass Media Query Variables
//== Media queries breakpoints
// Extra small screen / phone
$screen-xs: 480px;
$screen-xs-min: $screen-xs;
// Small screen / tablet
$screen-sm: 768px;
$screen-sm-min: $screen-sm;