Skip to content

Instantly share code, notes, and snippets.

View danielfttorres's full-sized avatar

Daniel Torres danielfttorres

  • Sao Paulo, Brazil
View GitHub Profile
@danielfttorres
danielfttorres / gruntfile.js
Created December 15, 2013 21:34
Livereload: Express + Grunt
// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %>
(function () {
"use strict";
module.exports = function (grunt) {
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
@danielfttorres
danielfttorres / deploy_gh-pages
Created March 28, 2014 00:31
Deploy gh-pages from master branch
git subtree push --prefix site/ origin gh-pages
/**
* cbpAnimatedHeader.js v1.0.0
* http://www.codrops.com
*
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2013, Codrops
* http://www.codrops.com
*/
@danielfttorres
danielfttorres / media-queries.scss
Created September 18, 2014 04:42
Bootstrap Media Queries
@media (max-width: $screen-xs-max) {
/* Phone */
}
@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
/* Tablet */
}
@media (min-width: $screen-md-min) and (max-width: $screen-md-max) {
/* Desktop */
}
@media (min-width: $screen-lg-min) {
-- Acess MySQL with root
mysql -u root
-- Acess MySQL with a user
mysql -u your_username -p p4sw0rd
-- Display all databases
SHOW DATABASES;
-- Create a database
#!/bin/bash
# Put this in /hooks/after_prepare/
PLIST=platforms/ios/*/*-Info.plist
cat << EOF |
Add :NSAppTransportSecurity dict
Add :NSAppTransportSecurity:NSAllowsArbitraryLoads bool YES
Add :NSAppTransportSecurity:NSExceptionDomains:facebook.com:NSIncludesSubdomains bool YES
Add :NSAppTransportSecurity:NSExceptionDomains:facebook.com:NSThirdPartyExceptionRequiresForwardSecrecy bool NO
@danielfttorres
danielfttorres / multer-to-s3.js
Created November 15, 2015 01:05 — forked from adon-at-work/multer-to-s3.js
Sample File Upload From Multer to S3
var AWS = require('aws-sdk'),
fs = require('fs');
// http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html#Credentials_from_Disk
AWS.config.loadFromPath('./aws-config.json');
// assume you already have the S3 Bucket created, and it is called ierg4210-shopxx-photos
var photoBucket = new AWS.S3({params: {Bucket: 'ierg4210-shopxx-photos'}});
function uploadToS3(file, destFileName, callback) {
db.search(query, params, function(err, data) { // Busca de Vinyls na API Externa.
var discogsVinyls = data.results.map(function(item) { // `map` para selecionar as propriedades que quero.
var item = {
slug: slug(item.title).toLowerCase(),
discogsId: item.id,
cover: item.thumb || null,
title: item.title,
artists: item.artists || null,
genre: item.genre,