Skip to content

Instantly share code, notes, and snippets.

View davidnunez's full-sized avatar

David Nuñez davidnunez

View GitHub Profile
@davidnunez
davidnunez / coreaudio-reset.sh
Last active January 2, 2019 12:04
resets and fixes the audio on my macos laptop
#!/bin/bash
# alias: coreaudio audiocore
# tags apple sound reset audio
# 20120626091339 | NOTE | This code resets and fixes the audio on my osx os x laptop
sudo kill -9 `ps ax|grep 'coreaudio[a-z]' | awk '{print $1}'`
@davidnunez
davidnunez / uninstall_prezto.zsh
Last active December 31, 2018 01:52 — forked from csturtevant/uninstal_prezto.zsh
uninstall prezto from home directory
rm -rf ~/.zprezto ~/.zlogin ~/.zlogout ~/.zpreztorc ~/.zprofile ~/.zshenv ~/.zshrc
@davidnunez
davidnunez / unshortening.php
Last active December 9, 2021 04:31
Automatically Unshortening Links in Wordpress Posts
function unshorten_url($url) {
$ch = curl_init($url[0]);
curl_setopt_array($ch, array(
CURLOPT_FOLLOWLOCATION => TRUE, // the magic sauce
CURLOPT_RETURNTRANSFER => TRUE
CURLOPT_HEADER => TRUE,
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_SSL_VERIFYHOST => FALSE, // suppress certain SSL errors
CURLOPT_SSL_VERIFYPEER => FALSE,
));
(*
Parse Start and Due Dates script
By Ryan Oldford
Based on work by andyferra (https://gist.github.com/andyferra/64842)
change_case taken from http://www.macosxautomation.com/applescript/sbrt/sbrt-06.html
This script is used with TaskPaper to provide better start and due date support, as well as support for repeating tasks.
The script searches for @due and @start tags, converts their values to standard date code values,
then adds the appropriate "diff" tag whose value indicates how far away the due or start date is (negative = past, 0 = today).
Any tasks with a @repeat tag that are done are edited to remove the done tag and have their due tags updated.
@davidnunez
davidnunez / gist:11103266
Created April 20, 2014 02:22
broadcast intents from adb shell
am broadcast "intent:#Intent;action=r1d1_to_front;end"
am broadcast "intent:#Intent;action=ros_to_unity;end"
am broadcast -a edu.mit.media.prg.ros_android_intents.intent_to_ros -e data bar
date bucket count
2012-07-20 800 119
2012-07-20 900 123
2012-07-20 1000 173
2012-07-20 1100 226
2012-07-20 1200 284
2012-07-20 1300 257
2012-07-20 1400 268
2012-07-20 1500 244
2012-07-20 1600 191
@davidnunez
davidnunez / randomly pick items from inboard
Last active December 13, 2015 21:08
ruby script to randomly pick and open tagged items in pinboard for review
require 'pinboard_api'
PinboardApi.username = "USERNAME"
PinboardApi.password = "PASSWORD"
posts = PinboardApi::Post.all(tag: ARGV[0], meta:true)
posts = posts.reject {|post| post.tags.include? "@done"}
ARGV[1].to_i.times do
@davidnunez
davidnunez / gist:3355661
Created August 15, 2012 03:49
Find and remove files by name in directory and its subdirectories recursively
find . -name "*.meta" -print0 | xargs -0 -I {} rm -r {}
@davidnunez
davidnunez / gist:2795676
Created May 26, 2012 23:59
Script that copies selected items in omnifocus to a format suitable for pasting in my nvalt system
property newContextName : "txfr" --context the item will change to if changeContext = true
tell application "Finder"
set the clipboard to ""
end tell
tell application "OmniFocus"
@davidnunez
davidnunez / omnifocus_randomly_defer_next_review_date
Created May 24, 2012 01:11
Script that resets Omnifocus project's next review date to a random day in the next week (ex. to distribute review dates across the week)
tell application "OmniFocus"
tell document 1
tell (first document window whose index is 1)
set SelectedItemInMainView to selected trees of content
repeat with i from 1 to (count of SelectedItemInMainView)
set theSelectedTask to value of item i of SelectedItemInMainView