Skip to content

Instantly share code, notes, and snippets.

@dbazuin
dbazuin / bookmarklet.js
Created November 24, 2022 10:32 — forked from bramus/bookmarklet.md
Mastodon User Page Bookmarklet
javascript:(function(){
const MY_MASTO_LOCAL_DOMAIN = 'front-end.social'; /* 👈 Change this value */
const MY_MASTO_WEB_DOMAIN = MY_MASTO_LOCAL_DOMAIN; /* 👈 Only change this value if your Masto host is hosted an different domain than the LOCAL_DOMAIN */
function tryAndGetUserName() {
/* Profile with a moved banner (e.g. https://mastodon.social/@bramus): follow that link */
const userNewProfile = document.querySelector('.moved-account-banner .button')?.getAttribute('href');
if (userNewProfile) {
return userNewProfile.substring(2);
}
@dbazuin
dbazuin / Instructions.md
Created December 12, 2015 08:53 — forked from daneden/Instructions.md
Remap Caps Lock to Emoji on Mac

How to remap the caps lock key to the emoji selector on Mac

  1. Go to System Preferences -> Keyboard -> Modifier Keys...
  2. Change “Caps Lock” to “No action”
  3. Install Seil
  4. Change the Caps Lock key in Seil to keyCode 80 (F19)
  5. Install Karabiner
  6. Open Karabiner and go to Misc & Uninstall -> Open private.xml
  7. Copy the contents of this gist's example to the XML file and save
  8. In Karabiner, go to Change Keys -> Reload XML
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@dbazuin
dbazuin / Views overview
Last active August 29, 2015 14:12
Displays the active views on the current page
/**
* Implements hook_views_pre_view().
*/
function [module name]_views_pre_view($view) {
if (user_access('administrator')) {
$name = $view->name;
$display = $view->current_display;
$path = 'admin/structure/views/view/' . $name . '/edit/' . $display;
drupal_set_message(l($name, $path));
}
'source-command-specific' => array (
'sql-sync' => array (
'no-cache' => TRUE,
'structure-tables-key' => 'common',
),
),
'command-specific' => array (
'sql-sync' => array (
'structure-tables' => array(
'common' => array('cache', 'cache_block', 'cache_content', 'cache_filter', 'cache_form', 'cache_menu', 'cache_page', 'cache_rules', 'cache_update', 'cache_views', 'cache_views_data', 'ctools_css_cache', 'ctools_object_cache', 'search_dataset', 'search_index', 'search_node_links', 'search_total', 'accesslog', 'history', 'watchdog')
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@dbazuin
dbazuin / views-settings.php
Last active August 29, 2015 14:06
Views settings in settings.php
/**
* Views develop setting.
*/
$conf['views_ui_show_listing_filters'] = TRUE;
$conf['views_ui_show_advanced_help_warning'] = TRUE;
$conf['views_ui_show_master_display'] = TRUE;
$conf['views_ui_show_advanced_column'] = TRUE;
$conf['views_ui_display_embed'] = TRUE;
$conf['views_ui_custom_theme'] = '_default';
$conf['views_exposed_filter_any_label'] = 'new_any'; #options old_any or new_any
[user]
# Credentials.
name = Foo Bar
email = [email protected]
drupal = $(whoami)
[credential]
# Save passwords in ~/.git-credentials.
helper = store
#!/bin/sh
# Ensure a name parameter has been provided
if [ $# -eq 0 ]
then
echo "Please provide a project name"
exit 1
fi
# Save project name
//
// All lines starting with "//" will not show up in the style.css
// However, the following lines inside "/* ... */" WILL show up.
//
// The visible comment below is there to warn any developer who
// opens a .css file that they need to edit the .scss versions ONLY.
// But you already know that because you're reading this :)
//
/*