Skip to content

Instantly share code, notes, and snippets.

View juandesant's full-sized avatar

Juande Santander-Vela juandesant

View GitHub Profile
#!/bin/bash
# Encode a WAV to a finalized podcast MP3 with metadata, in the current directory
# Requires lame
# With Homebrew on Mac OS X: brew install lame
SHOW_AUTHOR="ATP"
EPISODE_NUMBER=104
EPISODE_TITLE="Minutiæ"
# -*- coding: utf-8 -*-
"""magics for using blockdiag.com modules with IPython Notebook
The module provides magics: %%actdiag, %%blockdiag, %%nwdiag, %%seqdiag
Sample usage (in IPython cell):
%%blockdiag
{
A -> B -> C;
#!/usr/bin/env perl
#
# http://daringfireball.net/2007/03/javascript_bookmarklet_builder
use strict;
use warnings;
use URI::Escape qw(uri_escape_utf8);
use open IO => ":utf8", # UTF8 by default
":std"; # Apply to STDIN/STDOUT/STDERR
@juandesant
juandesant / Battery Test — Safari.scpt
Created May 25, 2017 05:35 — forked from gruber/Battery Test — Safari.scpt
A simple test to load a series of web pages in Safari repeatedly until the battery runs out.
on run
set imessage_id to "" -- leave blank to skip sending periodic iMessage progress updates, put your iMessage ID here to get updates as the script runs
set delay_seconds to 5 -- Don't set to 0, it runs too fast. 0.75 is a good setting for "go fast".
set computer_name to do shell script "scutil --get ComputerName"
set os_version to do shell script "sw_vers -productVersion"
set os_build to do shell script "sw_vers -buildVersion"
set _uptime to do shell script "uptime"
set url_list to {"http://techmeme.com", "http://www.consumerreports.org/laptops/macbook-pros-fail-to-earn-consumer-reports-recommendation/", "https://twitter.com/panzer/status/812367550734401536", "http://www.politico.com/story/2016/12/foreign-travelers-social-media-232930", "http://www.macworld.com/article/3153384/gaming/nintendo-plans-to-release-2-or-3-mobile-games-a-year-after-super-mario-runs-success.html", "http://www.wsj.com/articles/cyber-experts-cite-link-between-dnc-hacks-and-aggression-against-uk
@juandesant
juandesant / Battery Test — Chrome.scpt
Created May 25, 2017 05:36 — forked from gruber/Battery Test — Chrome.scpt
A simple test to load a series of web pages in Chrome on MacOS repeatedly until the battery runs out.
on run
set imessage_id to "" -- leave blank to skip sending periodic iMessage progress updates, put your iMessage ID here to get updates as the script runs
set delay_seconds to 5 -- Don't set to 0, it runs too fast. 0.75 is a good setting for "go fast".
set computer_name to do shell script "scutil --get ComputerName"
set os_version to do shell script "sw_vers -productVersion"
set os_build to do shell script "sw_vers -buildVersion"
set _uptime to do shell script "uptime"
set url_list to {"http://techmeme.com", "http://www.consumerreports.org/laptops/macbook-pros-fail-to-earn-consumer-reports-recommendation/", "https://twitter.com/panzer/status/812367550734401536", "http://www.politico.com/story/2016/12/foreign-travelers-social-media-232930", "http://www.macworld.com/article/3153384/gaming/nintendo-plans-to-release-2-or-3-mobile-games-a-year-after-super-mario-runs-success.html", "http://www.wsj.com/articles/cyber-experts-cite-link-between-dnc-hacks-and-aggression-against-uk
@juandesant
juandesant / save_as_pdf.scpt
Created February 7, 2019 14:16 — forked from neosarchizo/save_as_pdf.scpt
Save as pdf by applescript
set AppleScript's text item delimiters to ".pdf"
repeat while true
tell application "System Events"
tell process "Your Application"
if exists window "Print" then
tell window "Print"
if not (exists sheet 1) then
click menu button "PDF"
repeat until exists menu item "Save as PDF…" of menu 1 of menu button "PDF"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@juandesant
juandesant / gitlab-tex-ci-2.md
Created June 17, 2019 16:38 — forked from murych/gitlab-tex-ci-2.md
Using GitLab CI for Building LaTeX

@joernhees With the new Features (CI, Pages) you can do a Workaround. I did this with my Latex Repo: .gitlab-ci.yml:

variables:
  USE_BIBTEX: 'false'
  TEX_FILES: 'yourfile' # examples: 'File1 File2' OR '*.tex'
  DESTINATIONFOLDER: "processed_pdfs"
@juandesant
juandesant / every
Created September 12, 2019 17:29 — forked from sorbits/every
Run «command» only every «number» time invoked
#!/usr/bin/env bash
progname=$(basename $0)
version="1.0 (2014-08-17)"
step=2
function create_hash {
openssl dgst -sha1 -binary <<< "$1" | xxd -p
}
@juandesant
juandesant / wheeler.md
Created March 13, 2020 16:00 — forked from kimsk/wheeler.md
THE USE OF SUB-ROUTINES IN PROGRAMMES

D. J. Wheeler

Cambridge & Illinois Universities

A sub-routine may perhaps best be described as a self-contained part of a programme, which is capable of being used in different programmes. It is an entity of its own within a programme. There is no necessity to compose a programme of a set of distinct sub-routines; for the programme can be written as a complete unit, with no divisions into smaller parts. However it is usually advantageous to arrange that a programme is comprised of a set of subroutines, some of which have been made specially for the particular programme while others are available from a library of standard sub-routines. The reasons for this will be discussed below.

When a programme has been made from a set of sub-routines the breakdown of the code is more complete than it would otherwise be. This allows the coder to concentrate on one section of a programme at a time without the overall detai