Skip to content

Instantly share code, notes, and snippets.

function byId(id) {
return document.querySelectorAll(`[data-bi-id=${id}]`)[0]
}
function text(el) {
return el?.textContent || el?.innerText
}
function currentPage() {
el = document.querySelectorAll('.SiteNavigation__link--active')[0]
@Royce
Royce / ASimpleQuery.cs
Last active August 29, 2015 14:07
CQ Infrastructure
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Prject.Config;
using Project.Database.Entities;
using NHibernate;
namespace Project.Queries
{
// I just want to get all the units from the db.
@Royce
Royce / flac-to-mp3.rb
Created May 22, 2012 04:30 — forked from micahbrich/flac-to-mp3.rb
Batch convert flac to mp3, with metadata, using ffmpeg
Dir.glob("*.flac").each do |f|
flac = "./#{f.gsub(' ', '\ ')}"
mp3 = "./#{f.gsub(' ', '\ ').chomp('.flac')}.mp3"
system("ffmpeg -i #{flac} -map_metadata 0:g:0 #{mp3}")
end
@Royce
Royce / .bash_profile
Created September 21, 2011 03:00
.bash_profile file used at work for Git Bash on windows
function set_window_title
{
local title="$1"
if [[ -z "$title" ]]; then
title="root"
fi
# Set window title
echo -n -e "\033]0;${title}\a"
}