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
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@brynner
brynner / gulpfile.js
Created June 26, 2017 17:38 — forked from franksmule/gulpfile.js
gulp.js that does SASS, JS Concatenation Watching - Tutorial -> http://omcfarlane.co.uk/install-gulp-js-windows/
//*********** IMPORTS *****************
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var gutil = require('gulp-util');
var rename = require("gulp-rename");
var map = require("map-stream");
var livereload = require("gulp-livereload");
var concat = require("gulp-concat");
var uglify = require('gulp-uglify');
var watch = require('gulp-watch');
@brynner
brynner / package.json
Last active June 26, 2017 17:50 — forked from franksmule/package.json
Package.json for the gulp.js file - Tutorial -> http://omcfarlane.co.uk/install-gulp-js-windows/
{
"name": "MeuProjeto",
"version": "1.0.0",
"dependencies": {
"gulp": "*",
"gulp-ruby-sass": "*",
"gulp-util": "*",
"gulp-rename": "*",
"map-stream": "*",
"gulp-livereload": "*",
@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;
@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 / 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 / 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 / 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 / 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