Skip to content

Instantly share code, notes, and snippets.

View pedrorocha-net's full-sized avatar

Pedro Rocha pedrorocha-net

  • Lisboa, Portugal
View GitHub Profile
@pedrorocha-net
pedrorocha-net / gulpfile.coffee
Created July 15, 2016 16:53
Setup for SASS with Gulp
gulp = require 'gulp'
$ = require('gulp-load-plugins')({
pattern: ['gulp-*', 'run-sequence']
});
sources =
sass: 'docroot/sites/all/themes/nylottery/assets/scss/**/*.scss'
destinations =
@pedrorocha-net
pedrorocha-net / color_generator.php
Created April 24, 2018 02:01
PHP file to randomly generate a color palette
<style>
div {
float: left;
width: 12.5%;
padding: 40px 0;
line-height: 30px;
text-align: center;
color: #fff;
font-family: Verdana;
}
@pedrorocha-net
pedrorocha-net / sparkar_tap_counter_persistence.js
Last active January 8, 2021 14:25
Spark AR script that uses Persistence module to save the number of taps a user does on screen
const Scene = require('Scene');
const Persistence = require('Persistence');
const Diagnostics = require('Diagnostics');
const Patches = require('Patches');
// Esperamos por todos os itens que iremos usar do SparkAR ficarem disponíveis
Promise.all([
Patches.outputs.getPulse('wasTapped'),
Scene.root.findFirst('2dText0'),
]).then(results => {
@pedrorocha-net
pedrorocha-net / laravel_media_library_migrate.php
Created February 17, 2022 20:00
Laravel + Media Library code to migrate files from local filesystem to AWS S3
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Spatie\MediaLibrary\Models\Media;
class MigrateFiles extends Command
{
protected $signature = 'migrate-files';