- Open and bring to front a specific app
osascript -e "tell application \"APP\" -e "activate" -e "end tell"
osascript -e 'tell app "Terminal" to activate'
osascript -e 'tell app "Terminal" to do script "cmatrix"'
function writeCSS(css) { | |
var head = document.head || document.getElementsByTagName('head')[0], | |
style = document.createElement('style'); | |
style.type = 'text/css'; | |
if(style.styleSheet) { | |
style.styleSheet.cssText = css; | |
} else { | |
style.appendChild(document.createTextNode(css)); | |
} |
add_action('init', 'custom_image_sizes'); | |
function custom_image_sizes() | |
{ | |
add_image_size('medium', get_option( 'medium_size_w' ), get_option( 'medium_size_h' ), 'center' ); | |
add_image_size('large', get_option( 'large_size_w' ), get_option( 'large_size_h' ), 'center' ); | |
} |
add_filter('wp_update_attachment_metadata', 'filter__wp_update_attachment_metadata', 90, 2); | |
function filter__wp_update_attachment_metadata($data, $post_id) | |
{ | |
return $data; | |
$time = current_time( 'mysql' ); | |
$y = substr( $time, 0, 4 ); | |
$m = substr( $time, 5, 2 ); | |
$type = get_post_mime_type($post_id); | |
$type = explode('/', $type); |
export default callback => { | |
if (document.readyState === 'complete' || | |
(document.readyState !== 'loading' && !document.documentElement.doScroll)) { | |
callback() | |
} else { | |
document.addEventListener('DOMContentLoaded', callback, false) | |
} | |
} |
/* Generates an action creator FSA compliant | |
* Based on 'redux-actions' createAction method | |
* https://github.com/acdlite/redux-actions/blob/master/src/createAction.js | |
*/ | |
export default function createAction (type, payloadTransform, metaTransform) { | |
return (...args) => { | |
const action = { type } | |
const payload = | |
args[0] instanceof Error || typeof payloadTransform !== 'function' | |
? args[0] |
<header class="header js-header" role="banner"> | |
<a class="brand" href="{{ home_url('/') }}">{{ $site_name }}</a> | |
<button class="burger js-burger" aria-label="Toggle Main Menu" aria-expanded="false" aria-haspopup="true"> | |
<span class="burger__slices"><span>Toggle Main Menu</span></span> | |
</button> | |
<div class="header__overlay js-header-overlay"> | |
{!! $primary_menu !!} | |
</div> |
fluid($prop, $fluidVal, $min, $max = false, $fallback = false) | |
$responsive-unit = unit($fluidVal) | |
$responsive-unitless = remove-unit($fluidVal) | |
$min-bp = $min / $responsive-unitless * 100 | |
$max-bp = ($max != false) ? $max / $responsive-unitless * 100 : 0 | |
$minQueries = () | |
$maxQueries = () | |
$dimensions = (width height) |
#!/usr/bin/env bash | |
# Needs ffmpeg and handbrakeCLI | |
DOTFILES_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
IN_DIR=${1:-"$DOTFILES_DIR/in"} | |
OUT_DIR=${2:-"$DOTFILES_DIR/out"} | |
CUR_TIMESTAMP=`date +'%d/%m/%Y %H:%M:%S'` | |
echo "### INIT: $CUR_TIMESTAMP" >> log.txt | |
find "$IN_DIR" -type f \( -iname \*.mp4 -o -iname \*.mov -o -iname \*.avi \) -print0 | while IFS= read -r -d '' ORIGIN_PATH; |
The modern web package ecosssystem is overloaded with packages and it's very easy to forget that each dependency of our project can have tons of other dependencies.
Sometimes you get an error in a file of a dependency that you've never heard of and it's not listed in your package.json
. How can we find the direct dependency of our project that has, down its tree, this elusive dependency?