Skip to content

Instantly share code, notes, and snippets.

I am attesting that this GitHub handle zehfernandes is linked to the Tezos account tz1hE5XwhncgYJp8djD79u9zDDfCnipsvBdL for tzprofiles
sig:edsigu4YJYukNm7bFNdPF9Pwq3pg27kPyUh9hURkjdgnSanVnmwqXVxkAsx84JggcKeWjL5BdqKCu1PZzR2YCb3TekLDydkMHfz
@zehfernandes
zehfernandes / optimize-assets.md
Last active August 28, 2023 14:18
Recursively optimize MOV, MP4, WEBp using command line

Optimize assets

.mov to .mp4

Convert and remove the .mov file from all folders in the given directory.

find . -type f -name "*.mov" -exec bash -c 'ffmpeg -i "$0" -vcodec h264 "${0%.*}.mp4" && rm "$0"' "{}" \;
@zehfernandes
zehfernandes / App.js
Last active November 14, 2018 21:40
Workshop React Native - Part 2
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import { createStackNavigator } from "react-navigation";
import HomePage from "./pages/Home";
import CheckinPage from "./pages/Checkin";
export default createStackNavigator(
{
Home: {
@zehfernandes
zehfernandes / Home01.js
Created November 14, 2018 21:36
Workshop React Native - Part I
import React from "react";
import {
StyleSheet,
View,
Image,
Dimensions,
} from "react-native";
const { width, height } = Dimensions.get("window");
export default class Home extends React.Component {
videos = document.querySelectorAll('video')
videos.forEach(function(element) {
var promise = element.play();
if (promise !== undefined) {
promise.then(_ => {
// Autoplay started!
}).catch(error => {
element.setAttribute("controls","controls")
});
{InputLayer} = require "input"
# Loop to all layers and find the inputs
inputs = Framer.CurrentContext._layers.filter((a) =>
return a.name == "input"
)
# Replace the inputs
for l in inputs
# map propertie by properties
@zehfernandes
zehfernandes / pliim-turnOff.scpt
Last active December 17, 2023 22:15
One click and be ready to go up on stage and shine! - https://zehfernandes.github.io/pliim/
# Turn on Notifications
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -bool FALSE; defaults -currentHost delete com.apple.notificationcenterui doNotDisturbDate; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" -- this set 'Do not disturb' to false in the pref
# Show Desktop
do shell script "defaults write com.apple.finder CreateDesktop -bool true; killall Finder"
# Show all windows
tell application "System Events"
set visible of (every process) to true
end tell
tell application "Finder"
set folderFiles to (choose folder with prompt "Please select directory.")
set file_list to name of every file of entire contents of folderFiles
end tell
tell application "Keynote"
activate
tell the front document
repeat with fileName in file_list
set the newSlide to make new slide

Keybase proof

I hereby claim:

  • I am zehfernandes on github.
  • I am zehfernandes (https://keybase.io/zehfernandes) on keybase.
  • I have a public key ASC0fwgIxAPs4-sKv2NbIni9YWyQ_vs1Y5GiWpqwvQ5I7Ao

To claim this, I am signing this object:

const ffmpeg = require('fluent-ffmpeg');
const moment = require('moment');
var myArgs = process.argv.slice(2);
//Convert Video
var filePath = myArgs[0];
var startTime = moment(myArgs[1], "HH:mm:ss.SSS");
var endTime = moment(myArgs[2], "HH:mm:ss.SSS");
var fileOutput = myArgs[3];