Skip to content

Instantly share code, notes, and snippets.

View forsgren's full-sized avatar

Kristoffer Forsgren forsgren

View GitHub Profile

Keybase proof

I hereby claim:

  • I am forsgren on github.
  • I am forsgren (https://keybase.io/forsgren) on keybase.
  • I have a public key whose fingerprint is DCEF ADC2 8558 3417 3AAF A446 1B07 913F 6353 392F

To claim this, I am signing this object:

function reloadThisPagePlz() {
var reload_variants=["location=location","location=location.href","location=window.location","location=self.location","location=window.location.href","location=self.location.href","location=location['href']","location=window['location']","location=window['location'].href","location=window['location']['href']","location=window.location['href']","location=self['location']","location=self['location'].href","location=self['location']['href']","location=self.location['href']","location.assign(location)","location.replace(location)","window.location.assign(location)","window.location.replace(location)","self.location.assign(location)","self.location.replace(location)","location['assign'](location)","location['replace'](location)","window.location['assign'](location)","window.location['replace'](location)","window['location'].assign(location)","window['location'].replace(location)","window['location']['assign'](location)","window['location']['replace'](location)","self.location['assi
@forsgren
forsgren / IFTTTDate.md
Created August 19, 2019 15:34 — forked from oscarmorrison/IFTTTDate.md
Make IFTTT Date Format play nice with Google Spreadsheets

##Date and Time

=TIMEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " ")) + DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Date

=DATEVALUE(SUBSTITUTE("{{OccurredAt}}"," at ", " "))

##Time

@forsgren
forsgren / plink-plonk.js
Created February 15, 2020 18:17 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@forsgren
forsgren / dump-mamp-mysql-dbs.sh
Created January 11, 2022 20:40 — forked from salcode/dump-mamp-mysql-dbs.sh
Shell Script to dump all MAMP DBs into separate files
# based on http://www.commandlinefu.com/commands/view/2916/backup-all-mysql-databases-to-individual-files
# but modified for the MAMP path and to include default root/root as username and password
for I in $(/Applications/MAMP/Library/bin/mysql -u root -proot -e 'show databases' -s --skip-column-names); do /Applications/MAMP/Library/bin/mysqldump -u root -proot $I | gzip > "$I.sql.gz"; done
mysql -u root -p < /path/to/sql/frile/multiDB.sql
@forsgren
forsgren / wordpress-change-url.php
Created December 8, 2022 12:09 — forked from lavoiesl/wordpress-change-url.php
PHP script to replace site url in Wordpress database dump, even with WPML
#!/usr/bin/env php
<?php
/**
* PHP script to replace site url in Wordpress database dump, even with WPML
* @link https://gist.github.com/lavoiesl/2227920
*/
if (!empty($argv[1]) && $argv[1] == 'update') {
$file = file_get_contents('https://gist.github.com/lavoiesl/2227920/raw/wordpress-change-url.php');
if ($file === false) {
@forsgren
forsgren / macos-disable-resize
Created September 1, 2023 09:27 — forked from olssonm/macos-disable-resize
Disable resizing of the macOS dock
defaults write com.apple.dock size-immutable -bool true; killall Dock
#!/usr/bin/env zsh
sleep 10 &!
pid=$! # Process Id of the previous running command
spin='⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓'
i=0
while kill -0 $pid 2>/dev/null; do
i=$(((i + 1) % 10))
printf "$fg[magenta]\r${spin:$i:1}"

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.