Skip to content

Instantly share code, notes, and snippets.

View vspedr's full-sized avatar

Victor vspedr

  • Campinas, Brazil
View GitHub Profile
@PuKoren
PuKoren / AWS_deploy.sh
Created January 14, 2015 16:28
Travis script used to deploy on AWS ElasticBeanstalk (inspired from Codeship's one)
#!/bin/bash
# v0.0.2
# AWS Deploy Script for Travis
# Remember to add the env var in the travis configuration
# in order to work, this scripts needs:
# AWS_ACCESS_KEY_ID: user ID
# AWS_SECRET_ACCESS_KEY: user secret
# APP_NAME: EBS application name
# APP_ENV: EBS application env
# S3_BUCKET: name of the S3 bucket to store deployment archive
@kennbrodhagen
kennbrodhagen / launch.rb
Created January 27, 2013 22:55
calabash-cucumber launch.rb that will not restart the iOS Simulator for each scenario but still restart the app itself each time.
########################################
# #
# Important Note #
# #
# When running calabash-ios tests at #
# www.lesspainful.com #
# this file will be overwritten by #
# a file which automates #
# app launch on devices. #
# #
const path = require('path');
const fs = require('fs');
const express = require('express');
const React = require('react');
const App = require('./transpiled/App.js').default;
const { renderToString } = require('react-dom/server');
const server = express();
server.get('/', (req, res) => {
class ProgrammaticallyTextFilter extends React.Component {
/* There're two way that you can filter data */
handleBtnClick = () => {
this.refs.nameCol.applyFilter('Item name 3');
}
/* This is also work for filtering */
handleBtnClick1 = () => {
this.refs.table.handleFilterData({ name: 'Item name 3' });
@nuxlli
nuxlli / README.md
Created July 14, 2016 18:19
Testing `react-native` applications

Sobre

Não é simples fazer testes de aplicações react-native no device, por isso a maior parte das pessoas preferem testar separadamente os componentes (test unitários) usando o node.js e usar outras ferramentas para test de integração.

Dessa forma os testes unitários são como qualquer outro teste node.js. Você é livre para usar qualquer framework de testes, apesar da documentação oficial recomendar o uso do jest.

Pontos chave

  • Referências: Por se tratar de uma tecnologia em franca fase de desenvolvimento, muitas das referências para react-native estão desatualizadas ou imprecisas. Tome bastante cuidado principalmente no que se refere a syntax de ES5 e ES6;
@catchin
catchin / MultilineTextInput.js
Last active July 31, 2018 04:07
This is a workaround for the buggy react-native TextInput multiline on Android. Inspired by the comments on https://github.com/facebook/react-native/issues/12717.
import React, {PropTypes, PureComponent} from 'react';
import {TextInput} from 'react-native';
import debounce from 'debounce';
/**
* This is a workaround for the buggy react-native TextInput multiline on Android.
*
* Can be removed once https://github.com/facebook/react-native/issues/12717
* is fixed.
*
@automagicaly
automagicaly / .bashrc
Last active September 5, 2018 20:09
git branch on command line
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
#############################################
# Functions
#############################################
get_git_branch(){
@delemach
delemach / slackNotify.js
Last active November 1, 2018 18:41 — forked from turret-io/slackNotify.js
Parse SNS notification from Elastic Beanstalk and publish to Slack channel
var http = require('https');
var querystring = require('querystring');
// set the post request options
var reqOptions = {
hostname: 'hooks.slack.com',
port: 443,
path: '/services/YOUR/SLACK/HOOK_HERE',
method: 'POST'
};
@herrfugbaum
herrfugbaum / random-pastel-rgba.js
Created March 11, 2016 10:09
Return a random pastel rgba color.
/* @param alpha boolean
* if true a random value for the alpha channel is calculated, else alpha channel = 1 (full saturation)
*/
var randomPastelColor = function (alpha) {
var rndm = function (f) { return Math.floor(Math.random() * f)},
pstlfy = function (p) { return Math.round((p + 255) / 2)},
r = pstlfy(rndm(256)),
g = pstlfy(rndm(256)),
b = pstlfy(rndm(256)),
a = alpha ? rndm(11) / 10 : 1
const log = new Proxy({}, {
get: (_, colour) => function() {
console.log(`%c ${[].slice.call(arguments).join(' ')}`, `color: ${colour}`)
}
})
// example
log.tomato('I am tomato')
log.chocolate('I am chocolate')
log.cornflowerblue('I am cornflowerblue')