Skip to content

Instantly share code, notes, and snippets.

View felipedaraujo's full-sized avatar

Felipe de Araujo felipedaraujo

View GitHub Profile
@jwo
jwo / mysql.database.yml
Last active July 10, 2024 18:15
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
@webinista
webinista / array.chunk.js
Last active March 29, 2023 23:02
Array.prototype.chunk: Splits an array into an array of smaller arrays containing `groupsize` members
/*
Split an array into chunks and return an array
of these chunks.
With kudos to github.com/JudeQuintana
This is an update example for code I originally wrote 5+ years ago before
JavaScript took over the world.
Extending native objects like this is now considered a bad practice, so use
@loicknuchel
loicknuchel / angularPlugin.js
Created January 21, 2015 10:20
Angular MediaSrv : play audio with Cordova & Ionic apps
angular.module('my.cordova.plugins', ['ionic'])
// for media plugin : http://plugins.cordova.io/#/package/org.apache.cordova.media
.factory('MediaSrv', function($q, $ionicPlatform, $window){
var service = {
loadMedia: loadMedia,
getStatusMessage: getStatusMessage,
getErrorMessage: getErrorMessage
};
@busypeoples
busypeoples / package.json
Last active December 20, 2017 13:37
Testing in React: Basic Examples + Setup
{
"name": "example-karma-jasmine-webapck-test-setup",
"description": "React Test Setup with Karma/Jasmine/Webpack",
"scripts": {
"test": "karma start --single-run --browsers PhantomJS"
},
"devDependencies": {
"babel": "^6.5.2",
"babel-core": "^6.5.2",
"babel-eslint": "^5.0.0",
@tianweiliu
tianweiliu / firebaseStorage.js
Last active July 11, 2018 01:07
angular factory for angular firebase upload
.factory('$firebaseStorage', ['$q', function($q) {
var $firebaseStorage = {
_ref: firebase.storage().ref(),
upload: function(_path, _file, _onProgress) {
return $q(function(resolve, reject) {
if (!_path) {
reject(new Error('no path'));
}
else if (!_file) {
reject(new Error('no file'));
@lfalke
lfalke / StripeCardsSection.js
Last active August 8, 2023 05:10
Usage of react-stripe-elements with Material UI (v1.0) styling
import React, { PureComponent } from 'react'
import Grid from 'material-ui/Grid'
import { CardNumberElement, CardExpiryElement, CardCVCElement } from 'react-stripe-elements'
import StripeElementWrapper from './StripeElementWrapper'
export default class extends PureComponent {
static displayName = 'StripeCardsSection'
@reintroducing
reintroducing / cloudSettings
Last active November 11, 2021 22:55
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-11-11T22:55:23.414Z","extensionVersion":"v3.4.3"}