This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env osascript | |
tell application "System Events" | |
tell process "NotificationCenter" | |
tell window 1 | |
tell scroll area 1 | |
tell UI element 1 | |
tell group 1 | |
if exists then | |
set current_mouse_xy to (do shell script "/usr/local/bin/cliclick p") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
sqlite3 ~/Library/Messages/chat.db "SELECT text FROM message WHERE text LIKE '%code is%' ORDER BY date DESC LIMIT 1;" | | |
sed -E 's/[^0-9]//g' | | |
tr -d '\n' | | |
pbcopy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ::Exception | |
def new_initialize(*args) | |
original_initialize(*args) | |
puts "[custom error message]: #{self.message}" | |
end | |
alias original_initialize initialize | |
alias initialize new_initialize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Put this into: .git/hooks/prepare-commit-msg | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
BRANCHES_TO_SKIP=(master main env/development env/staging env/production); | |
for b in "${BRANCHES_TO_SKIP[@]}"; do | |
BRANCHES_TO_SKIP=("${BRANCHES_TO_SKIP[@]}" "$b-slave") | |
done; | |
BRANCH_NAME=$(git symbolic-ref --short HEAD | sed 's/heads\///') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"call dein#add(Scripts-----------------------------) | |
if &compatible | |
set nocompatible " Be iMproved | |
endif | |
" Required: | |
set runtimepath+=~/.vim/dein/repos/github.com/Shougo/dein.vim | |
" Required: | |
call dein#begin(expand('~/.vim/dein')) " plugins' root path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- APP COMPONENT --> | |
<app> | |
<dashboard></dashboard> | |
</app> | |
<!-- DASHBAORD COMPONENT --> | |
<template> | |
<div>[[referral.balance]]</div> | |
<template is="dom-if" if="is-loading"> | |
Loading... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[].slice.apply(document.querySelectorAll(".ghx-selected .ghx-key")).map(a => a.innerHTML).filter(a => a.indexOf("ECOM-") != -1).join(" ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_postal_code(street, city, state){ | |
var cache_seconds = 60 * 60 * 24 * 365 // cache for 1 year | |
var address = [street, city, state, "United States"].join(", ") | |
var cache = CacheService.getScriptCache(); | |
var cached = cache.get(address); | |
if (cached != null) { | |
return cached; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION "json_object_delete_keys"("json" json, VARIADIC "keys_to_delete" TEXT[]) | |
RETURNS json | |
LANGUAGE sql | |
IMMUTABLE | |
STRICT | |
AS $function$ | |
SELECT COALESCE( | |
(SELECT ('{' || string_agg(to_json("key") || ':' || "value", ',') || '}') | |
FROM json_each("json") | |
WHERE "key" <> ALL ("keys_to_delete")), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../paper-radio-button/paper-radio-button.html"> | |
<link rel="import" href="../paper-slider/paper-slider.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; |
NewerOlder