Skip to content

Instantly share code, notes, and snippets.

@timothycomeau
timothycomeau / excel_filter.md
Created March 12, 2025 15:33
Filtering with Excel

Filtering with Excel

In the cases where I wanted to filter info from a .CSV file

Load Data into Excel

First, for the data to ensure that the data displays correctly, in Excel create a blank workbook, then go to

Data → Get Data → From File → From Text CSV → [choose file] → Import

@timothycomeau
timothycomeau / link_blue.md
Created June 6, 2023 16:11
Link Blue #html
@timothycomeau
timothycomeau / meta_terminal.md
Created November 5, 2022 00:07
Using Terminal to read the meta data of a file #unix #terminal #meta

mdls filename

@timothycomeau
timothycomeau / basic_accordion_dropdown.md
Last active October 27, 2021 19:32
Basic Accordion Drop-down #javascript
function toggleElement(tag, buttonId){
let div = document.getElementById(tag)
let btn = document.getElementById(buttonId)

if (div.classList.contains("hide")) {   
    div.classList.remove('hide')
    btn.innerHTML="▾"
    } else {
 div.classList.add('hide')
@timothycomeau
timothycomeau / background_css.md
Created October 13, 2021 16:57
Background Image CSS #css #html
#banner {
    background-image: url(URL-TO-IMAGE);
    background-repeat: no-repeat;
    background-position: bottom;
    background-size: cover;
    height: 400px;
    max-width: 1280px;
    margin: 0 auto;
 padding: 40px 0 0 0;
@timothycomeau
timothycomeau / git_checkout_from_another_branch.md
Last active April 30, 2023 18:41
Git checkout from another branch #git
@timothycomeau
timothycomeau / click_to_tweet.md
Created September 22, 2021 21:27
Click to Tweet #twitter #facebook

Click to Tweet

<a href="https://twitter.com/intent/tweet?text=Today%20is%20%23GivingTuesdayCA%2C%20a%20day%20dedicated%20to%20giving%20back%21%20Join%20the%20global%20giving%20movement" target="_blank">Link</a>
<br><br>
<a href="https://twitter.com/intent/tweet?text=Lorem%20Ipsum%20%23EarthDay🌏" target="_blank">Link</a>

%23 encodes the hash %20 encodes the space

@timothycomeau
timothycomeau / audio_convert.md
Last active March 12, 2023 21:27
Convert Audio M4a to MP3 Command Line #bash #unix #zsh #audio

Covert Audio

Convert to aac

ffmpeg -i FILE.mp4 -vn -acodec copy FILE.aac

then to mp3

@timothycomeau
timothycomeau / twitter_tip_of_the_tongue.md
Created August 12, 2021 21:57
Twitter: Search for things you might have seen #twitter

ProTip: if you have Twitter Tip of The Tongue trying to find something you saw on twitter but can't find again because it might have been a retweet from someone you dont follow , use include:nativeretweets [what you saw] and select People You Follow

@timothycomeau
timothycomeau / js_to_switch_based_on_url.md
Last active July 29, 2021 02:56
Use Javascript to switch iframes based on URL #js #Javascript

Use Javascript to switch iFrames based on URL using if/else

// gets the value of the URL
let url = window.location.href;

// in our example, the urls are either Eng or Fre
// eg. http://localhost/Eng.html or http://localhost/Fre.html
// both Eng.html & Fre.html have an empty div with id 'iframe-container'
if (url.indexOf("Fre")&gt;-1) {