Skip to content

Instantly share code, notes, and snippets.

jorge jardines gardenunez

Block or report user

Report or block gardenunez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ts_2_mp4.py
#!/usr/bin/env python3
import os
import sys
walk_dir = os.getcwd()
count = 0
def from_ts_to_mp4(source_file, dest_file):
os.system("ffmpeg -i {} -c:v copy -c:a copy {}".format(source_file, dest_file))
View ffmpg_recipes.md

ffmpg recipes

Convert from ts to mp4

ffmpeg -i input.ts -c copy output.mp4

Concatenate

ffmpeg -i 'concat:input-1.ts|input-2.ts|input-3.ts' -codec copy output.ts

Remove subtitles

ffmpeg -i <input> -c:v copy -c:a copy -sn <output>

View example_feed_dat_hotel.xml
<?xml version="1.0" encoding="UTF-8"?>
<listings>
<title>My Hotel Feed</title>
<listing>
<hotel_id>1234</hotel_id>
<name>The best hotel</name>
<description>A very nice hotel</description>
<brand>Premium_brand</brand>
<address format="simple">
<component name="addr1">100 Main Street</component>
View example_feed_dat_hotel_40.xml
<?xml version="1.0"?>
<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">
<channel>
<title>The Title</title>
<link>http://www.example.com</link>
<description>An example item from the feed</description>
<item>
<g:id>DB_1</g:id>
<g:availability>in stock</g:availability>
<g:condition>new</g:condition>
@gardenunez
gardenunez / delete_branches.sh
Created Jul 17, 2017
delete-branches-but-master
View delete_branches.sh
git branch | grep -v master | xargs git branch -D
View git-aliases.sh
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1 HEAD'
@gardenunez
gardenunez / github-clone-org.sh
Created Oct 28, 2016
clone github organization repositories
View github-clone-org.sh
curl -u $1:$2 -s "https://api.github.com/orgs/$3/repos?per_page=200" | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
View update_git_repos.sh
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@gardenunez
gardenunez / git-author-rewrite
Created Jul 12, 2016
rewrite author name and email in git repo
View git-author-rewrite
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
View arxiv_harvest.py
import urllib2
import time
import xml.etree.ElementTree as ET
from datetime import datetime
OAI = "{http://www.openarchives.org/OAI/2.0/}"
ARXIV = "{http://arxiv.org/OAI/arXiv/}"
def harvest(initial_date, end_date):
results = []
You can’t perform that action at this time.