Skip to content

Instantly share code, notes, and snippets.

View javier's full-sized avatar

javier ramírez javier

View GitHub Profile
@javier
javier / gist:fc90f3bbf265522d54526c2f0a44bdef
Created July 3, 2020 08:36 — forked from cmackay/gist:5863257
AppleScript to save and restore window position and sizes.
-- allSettings is a list of records containing {width:? height:? apps:{{name:? pos:? size:?},...}
-- for each display setup store the apps and their associated position and size
property allSettings : {}
-- create a variable for the current settings
set currentSettings to {}
display dialog "Restore or save window settings?" buttons {"Restore", "Save"} default button "Restore"
set dialogResult to result
@javier
javier / ffmpeg.md
Created May 13, 2020 09:36 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@javier
javier / opencv-python_rekognition.py
Created May 31, 2019 12:14 — forked from jakechen/opencv-python_rekognition.py
Using opencv to parse frames for Amazon Rekognition to analyze. This example uses Rekognition's celebrity recognition feature as an example.
# With help from https://aws.amazon.com/blogs/ai/build-your-own-face-recognition-service-using-amazon-rekognition/
frame_skip = 100 # analyze every 100 frames to cut down on Rekognition API calls
import boto3
import cv2
from PIL import Image
import io
rekog = boto3.client('rekognition')
@javier
javier / gist:4071356
Created November 14, 2012 10:14 — forked from eLafo/install.txt
My (elafo) install notes for ubuntu. Must be reviewed, but in the meanwhile... it's ok for me
# Update System
# ------------------------------------------------------------------------------
echo 'Updating System...'
sudo apt-get -y update
# Hardware
# ------------------------------------------------------------------------------
echo 'Installing bumblebee'
sudo add-apt-repository -y ppa:bumblebee/stable && sudo apt-get update
sudo apt-get -y install bumblebee bumblebee-nvidia
...
<td class="Text13Grey numeric">
<span id="invoice_paid_status_<%= invoice.url_id %>"> <%= partial_payment_in_redbox(invoice) %></span>
</td>
...
@javier
javier / jazzfonica.rb
Created June 14, 2011 11:29 — forked from ace/jazzfonica.rb
jazzfonica
#!/usr/bin/env ruby
# jazzfonica.rb for Mac OS X
# Scans the visible networks for JAZZTEL_XXXX or WLAN_XXXX and calculates the password
# Ported from PHP example at http://kz.ath.cx/wlan/codigo.txt
# Download and execute with ruby (e.g. ruby jazzfonica.rb) from a Terminal
#ported to ubuntu from https://gist.github.com/1024587
#it will ask for sudo privileges.
#if your wlan card is not "wlan0" change the "my_wifi_card" variable
module Categorizable
module ClassMethods
def acts_as_categorizable
has_many :audience_scopes, :as => :audienciable
has_many :audience_categories, :through => :audience_scopes
has_many :areas, :through => :audience_scopes