Skip to content

Instantly share code, notes, and snippets.

View fabiodamasceno's full-sized avatar
🏠
Working from home

Fábio Damasceno fabiodamasceno

🏠
Working from home
View GitHub Profile
@fabiodamasceno
fabiodamasceno / .m
Created March 11, 2020 13:08
React native orientation to swift
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return [Orientation getOrientation];
}
@fabiodamasceno
fabiodamasceno / gulpfile.config.js
Last active March 29, 2017 07:00
Browserify Gulpfile
'use strict';
var config = {
sass : {
errLogToConsole: true,
outputStyle: 'compressed'
},
bower: './bower_components',
source: {
main: '.src/',
html:{
//doSomething.js
var Promise = require(‘bluebird’)
module.exports = function(a, b){
var p = new Promise()
if(a > b)
p.reject()
p.resolve()
}
//doSomething.js > es6 v2
import Promise from 'bluebird'
export function sum(a, b) {
return a + b
}
export default (a, b) => {
let p = new Promise()
if(a > b)
//doSomething.js > es6
import Promise from 'bluebird'
export default (a, b) => {
let p = new Promise()
if(a > b)
p.reject()
p.resolve()
}
<script type=”text/javascript” src=”./main.js”></script>
npm run-script build
//index.js
var doSomething = require(‘./dosomething’)
console.log(‘doSomething’, doSomething);
scripts:{
"build": "browserify index.js > main.js"
}
// lib/math.js
export function sum(x, y) {
return x + y;
}
// app.js
import * as math from "lib/math";
console.log("2π = " + math.sum(math.pi, math.pi));