Skip to content

Instantly share code, notes, and snippets.

Richard Osmar Leon Ingaruca jrichardsz

View GitHub Profile
View atom snippets: cant delete file or folder
Solution
Create a new Trash directory that can be accessed from outside the user’s home directory:
# Create a Trash directory (with some subdirectories) in root
sudo mkdir -p /.Trash-1000/{expunged,files,info}
# Give ownership of this to your user:
sudo chown -R $USER /.Trash-1000
@jrichardsz
jrichardsz / ffmpeg remove section and join
Created Jun 28, 2020
ffmpeg remove section and join
View ffmpeg remove section and join
00:00
8:45
8:58
https://askubuntu.com/questions/977162/how-to-remove-a-few-seconds-from-mp4-file-using-ffmpeg
Goal: remove section from 00:08:39.500 to 00:08:58
part1 : from 0 to duration: 00:08:39.500
ffmpeg -i ini.mkv -ss 00:00:00 -t 00:08:39.500 -acodec copy -vcodec copy p1.mp4
View java properties
/**
* Copyright 2007 University Of Southern California
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
@jrichardsz
jrichardsz / imports
Created Jun 12, 2020
test nodejs snippet
View imports
var path = require('path');
global.imports = function importFunction(relativeModuleLocation) {
let paths = require.main.filename.split("node_modules")
return require(paths[0]+"src/main"+relativeModuleLocation);
}
@jrichardsz
jrichardsz / javascript http request snippets
Last active Jun 11, 2020
javascript http request snippets
View javascript http request snippets
https://stackoverflow.com/a/30008115/3957754
function makeRequest (method, url, done) {
var xhr = new XMLHttpRequest();
xhr.open(method, url);
xhr.onload = function () {
done(null, xhr.response);
};
xhr.onerror = function () {
done(xhr.response);
View Tampermonkey snippet localhost remove footer
@jrichardsz
jrichardsz / snippet1.js
Last active Jun 6, 2020
Rescheduling cron jobs in nodejs on server restart
View snippet1.js
//read all configurations from campaign_configurations
campaignConfigurationsService.findCampaignsToLaunch(function(campaignCronConfigurations){
//for each configuration
campaignCronConfigurations.forEach(function(campaignCronConfiguration, index){
//new entry on campaign_executions table
campaignExecutionsService.startNewExecution(campaignCronConfiguration.id, dateNow, function(execution){
var j = schedule.scheduleJob(campaignCronConfiguration.cronString, function(){
//if job is complete
View ffmpeg snippets remove partial audio
ffmpeg -i video.mp4 -af "volume=enable='between(t,5,10)':volume=0" -c:v copy video-sansson.mp4
View android snippet build with env variables.md

/acme-android/app/build.gradle

apply plugin: 'com.android.application'

android {
	compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
View mule esb snippets
MULE_STANDALONE_OPTS: -M-Duser.timezone=America/Lima -M-server -M-Djava.awt.headless=true -M-Dfile.encoding=UTF8 -M-Xms1024m -M-Xmx1024m -M-Djava.security.egd=file:/dev/./urandom -M-XX:ReservedCodeCacheSize=128m -M-XX:NewSize=128m -M-XX:MaxNewSize=128m -M-XX:PermSize=128m -M-XX:MaxPermSize=128m
MULE_HOME is set to /opt/mule
You can’t perform that action at this time.