Skip to content

Instantly share code, notes, and snippets.

View dbalatero's full-sized avatar

David Balatero dbalatero

View GitHub Profile

To start tracking dotfiles in git:

Create a dotfiles repo

cd $HOME
mkdir .dotfiles
cd .dotfiles
git init .

Create the two files in this gist

@dbalatero
dbalatero / hammerspoon_asm.lua
Created April 19, 2019 18:25
Dumping my experiments trying to get consistent textfield objects back in Hammerspoon with asmagill's asm lib
logger = hs.logger.new('explore', 'debug')
ax = require("hs._asm.axuielement")
inspect = hs.inspect.inspect
function getApplication(element)
return ax.applicationElementForPID(element:pid())
end
key = hs.hotkey.new({ "cmd", "alt", "ctrl" }, "0", nil, function()
lines = [
[spiegazione2[0], 300, 30, 0, baseColor, shadowColor],
[spiegazione2[1], 295, 50, 0, baseColor, shadowColor],
[spiegazione2[2], 295, 70, 0, baseColor, shadowColor],
[spiegazione2[3], 285, 90, 0, baseColor, shadowColor],
[spiegazione2[4], 285, 110, 0, baseColor, shadowColor],
[spiegazione2[5], 285, 130, 0, baseColor, shadowColor],
[spiegazione2[6], 285, 150, 0, baseColor, shadowColor],
[spiegazione2[7], 285, 170, 0, baseColor, shadowColor],
[spiegazione2[8], 285, 190, 0, baseColor, shadowColor],
var am = "data:image/jpeg;base64,/9j/4aaqskzjrgabaqaasabiaad/4qcarxhpzgaatu0akgaaaagabqesaamaaaabaaeaaaeaaauaaaabaaaasgebaauaaaabaaaaugeoaamaaaabaaiaaidpaaqaaaabaaaawgaaaaaaaabiaaaaaqaaaegaaaabaakgagaeaaaaaqaaaeqgawaeaaaaaqaaabqaaaaa/+0aofbob3rvc2hvccazljaaoejjtqqeaaaaaaaaoejjtqqlaaaaaaaq1b2m2y8asgtpgamy7phcfv/idohjq0nfufjprklmrqabaqaadnhhchbsahaaag1udhjsr0igwflaiafhaaeafwawaamaigfjc3bbufbmaaaaaefquewaaaaaaaaaaaaaaaaaaaaaaad21gabaaaaanmtyxbwbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaewrlc2maaafqaaaaymrzy20aaag0aaabvmnwcnqaaan0aaaai3d0chqaaaoyaaaafhjywvoaaaosaaaafgdywvoaaapaaaaafgjywvoaaapuaaaafhjuukmaaapoaaaidgfhcmcaaav0aaaaihzjz3qaaawuaaaamg5kaw4aaaxeaaaapmnoywqaaayeaaaalg1tb2qaaaywaaaakgjuukmaaapoaaaidgduukmaaapoaaaidgfhymcaaav0aaaaigfhz2caaav0aaaaigrlc2maaaaaaaaacerpc3bsyxkaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabtbhvjaaaaaaaaaciaaaamahjiugaaabyaaagoa29lugaaabyaaagobmjotwaaabyaaagoawqaaaaaabyaaagoahvivqaaabyaaagoy3ndwga
% irb
2.3.1 :001 > class A
2.3.1 :002?> class B
2.3.1 :003?> def self.fart
2.3.1 :004?> puts "fart " * 50
2.3.1 :005?> end
2.3.1 :006?> end
2.3.1 :007?> end
=> :fart
2.3.1 :008 > class C < A
@dbalatero
dbalatero / iframe_embed_fix.html
Created August 30, 2016 01:02
A fix for Neil's site to make sure any bad embeds get fixed
<script src="https://code.jquery.com/jquery-3.1.0.slim.min.js" integrity="sha256-cRpWjoSOw5KcyIOaZNo4i6fZ9tKPhYYb6i5T9RSVJG8=" crossorigin="anonymous"></script>
<script type="text/javascript">
// Fix for archive.org embed links that have erroneous http:// urls instead
// of https://
$(function() {
$("iframe").each(function(index, iframe) {
var $iframe = $(iframe);
var src = $iframe.attr('src');

Seeing a lot of repeat questions, so here's a quick voting guide that I assembled for tomorrow (please share this with friends):

  1. You need to caucus at your location - you cannot just show up wherever is closest. If your voter address is near your place, you'll be at the most convenient place by default.
  2. Use this tool to find + double-check your caucus location: https://vote.berniesanders.com/WA/
  3. Arrive at the caucus no later than 9:30am
  4. Pre-register for your caucus online and skip any hassle: https://www.demcaucus.com/register
  5. Double-check your voter status and print out a copy to bring with you at https://www.sos.wa.gov/elections/myvote in case you need it
  6. You do not need to be a registered Democrat to participate! Washington State does not have party registration and is an open primary. When you sign into caucus you will claim you are a Democrat. This is required, however it is only a formality to say that you are not there to sabotage the vote, nor are you going to turn around and caucus
1996 Vin Ordinaire Extraordinaire
1998-1999 Vin Ordinaire Extraordinaire
2000 Vin Ordinaire: My Search for an Affordable Everyday Wine
2001 Vin Ordinaire: My Search for an Affordable Everyday Wine
2002 Telephone Numbers for Wildflower Viewing Updates
2002 Vin Ordinaire: My Search for an Affordable Everyday Wine
2003 Vin Ordinaire: My Search for an Affordable Everyday Wine
2004 Vin Ordinaire: My Search for an Affordable Everyday Wine
2008 Vin Ordinaire: My Search for an Affordable Everyday Wine
A Brief History of Minesweepers in WWII
@dbalatero
dbalatero / burger.com.txt
Created December 1, 2015 02:31
burger.com
\_ Home Page of Donald Ray Burger, Attorney at Law, Houston, Texas
\_ Biographical Information
\_ Employment Experience
\_ Home Page of Donald Ray Burger, Attorney at Law, Houston, Texas
\_ How to Hire a Lawyer
\_ How I Bill
\_ Frequently Asked Questions
\_ Elements of a Good P/I Lawsuit in Texas
\_ Things You Should Know When Dealing with Insurance Companies
\_ Beware of Insurance Company Adjusters Who Seem Concerned about Your Well-Being
var N = {
sync: function (callback) {
callback();
return this;
}
}
N
.sync(function () {
console.log("hello there");