Skip to content

Instantly share code, notes, and snippets.

View frapontillo's full-sized avatar

Francesco Pontillo frapontillo

View GitHub Profile
@frapontillo
frapontillo / changelog.js
Last active November 18, 2015 08:08
Gulp AngularJS Full Lib Changelog Generation Task
'use strict';
var gulp = require('gulp');
var conventionalChangelog = require('gulp-conventional-changelog');
var transform = function(commit) {
var commitMap = {
'feat': 'Features',
'fix': 'Bug Fixes',
'docs': 'Documentation Changes',
@frapontillo
frapontillo / bump.js
Created November 18, 2015 08:08
Gulp Bump Tasks
'use strict';
var gulp = require('gulp');
var bump = require('gulp-bump')();
var bumpTargets = ['package.json', 'bower.json'];
['major', 'minor', 'patch'].forEach(function (type) {
gulp.task('bump:' + type, function () {
gulp.src(bumpTargets)
@frapontillo
frapontillo / install.sh
Last active November 30, 2015 22:01
Crowd Pulse Install Scripts
#!/usr/bin/env bash
# install build tools and node for ubuntu
sudo apt-get update -y
sudo apt-get install -y build-essential
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
cd /opt/
@frapontillo
frapontillo / RxTest.java
Last active May 23, 2016 17:43
RxJava retryWhen with dynamic delay
package com.novoda.github.reports;
import java.sql.Date;
import java.time.Instant;
import java.util.concurrent.TimeUnit;
import org.junit.Before;
import org.junit.Test;
import rx.Observable;
@frapontillo
frapontillo / giffify.sh
Last active June 18, 2019 12:28
Record Android screen straight to GIF
#!/bin/bash
if [ -z "$1" ]; then
shot_path=$(date +%Y-%m-%d-%H-%M-%S).mp4
else
shot_path="$*"
fi
# Enable show taps on screen
adb shell content insert --uri content://settings/system --bind name:s:show_touches --bind value:i:1
@frapontillo
frapontillo / rec-ios.sh
Last active September 16, 2021 06:14
Record video from an iOS emulator
#!/bin/bash
xcrun simctl io booted recordVideo --codec=h264 "$1".mp4;
@frapontillo
frapontillo / rec-android.sh
Last active September 16, 2021 06:13
Record a video from an Android device
#!/bin/bash
adb shell screenrecord --bit-rate 6000000 /sdcard/$1.mp4 & PID=$!
# Upon a key press
read -p "Press [Enter] to stop recording..."
# Kills the recording process
kill $PID
# Wait for 3 seconds for the device to compile the video
sleep 3
# Download the video
@frapontillo
frapontillo / android-demo.sh
Created May 27, 2021 12:52
Turn Android Demo Mode on and off
#!/bin/bash
on() {
adb shell settings put global sysui_demo_allowed 1 > /dev/null
adb shell am broadcast -a com.android.systemui.demo -e command enter > /dev/null
adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 1000 > /dev/null
adb shell am broadcast -a com.android.systemui.demo -e command network -e wifi show -e level 4 > /dev/null
adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level 4 -e datatype lte > /dev/null
adb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false > /dev/null
adb shell am broadcast -a com.android.systemui.demo -e command battery -e level 100 -e plugged false > /dev/null