Skip to content

Instantly share code, notes, and snippets.

View albertvaka's full-sized avatar
🥐
Doing stuff

Albert Vaca Cintora albertvaka

🥐
Doing stuff
View GitHub Profile
@Darkhogg
Darkhogg / !RebootToOs.md
Last active May 1, 2024 20:38
"Reboot to {OS}" scripts for rEFInd Next Boot selection

Reboot to {OS}

This a collection of notes and files used in my quest to create "Reboot to Windows" and "Reboot to Linux" scripts (and desktop shortcuts) for Linux and Windows respectively that automatically reboot my system and instruct rEFInd to auto-select the appropriate OS entry.

General Information

The key for achieving this is to modify the EFI Variable PreviousBoot with GUID 36d08fa7-cf0b-42f5-8f14-68df73ed3740, which rEFInd uses to store the last entry selected in the menu and, if using the + default entry, will be used to select the default OS. By doing this, we trick rEFInd into booting the OS we choose without having to be physically there to press the keyboard.

@teknikqa
teknikqa / lastfm_delete_loved.js
Created May 7, 2017 06:38
Bulk delete Last.FM scrobbles & loved tracks
// On the Last.FM website go to the page which lists the tracks that you have loved.
// Open Chrome DevTools (or Firefox or any modern browser that has a built in Javacript Console)
// and run the following command.
// This basically clicks on all the delete buttons on the page and reloads the page.
jQuery('.love-button--loved').each(function(_, b) {
b.click();
});
location.reload();
@sj26
sj26 / LICENSE.md
Last active March 8, 2024 18:31
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@fasterthanlime
fasterthanlime / glibc-check.sh
Last active June 9, 2023 09:16
Prints the various glibc versions required by an executable
#!/bin/bash
# This scripts lets you check which minimum GLIBC version an executable requires.
# Simply run './glibc-check.sh path/to/your/binary'
#
# You can set `MAX_VER` however low you want, although I (fasterthanlime)
# feel like `2.13` is a good target (For reference, Ubuntu 12.04 has GLIBC 2.15)
MAX_VER=2.13
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
@rickyah
rickyah / gist:10016784
Last active August 29, 2015 13:58
csharper_attributes

#C# Attributes

WIP

Attributes are just meta-data associated to the code.

You can create your own:

  • Create a child class of System.Attribute
  • The name of your attribute class should end with Attribute (convention sufix)
@rickyah
rickyah / gist:10016780
Last active August 29, 2015 13:58
csharper_properties

#C# Properties

Properties are getters & setters but well done.

They require minimal code for setup:

public int MyProperty {get;set;}

This declares a completely functional property. The compiler generates the member to store the property data automatically.

@flakas
flakas / hc-sr04.ino
Created August 8, 2012 12:41
Modified Arduino Ping))) example to work with 4-Pin HC-SR04 Ultrasonic Sensor Distance Measuring Module
/* HC-SR04 Sensor
https://www.dealextreme.com/p/hc-sr04-ultrasonic-sensor-distance-measuring-module-133696
This sketch reads a HC-SR04 ultrasonic rangefinder and returns the
distance to the closest object in range. To do this, it sends a pulse
to the sensor to initiate a reading, then listens for a pulse
to return. The length of the returning pulse is proportional to
the distance of the object from the sensor.
The circuit: