Skip to content

Instantly share code, notes, and snippets.

View SilverFire's full-sized avatar

Dmytro Naumenko SilverFire

  • HiQDev, Yii Framework
  • Kyiv, Ukraine
View GitHub Profile
@ieatfood
ieatfood / Connect Airpods.applescript
Last active May 16, 2024 09:52 — forked from jaredmoody/Connect Airpods.applescript
An Applescript to connect bluetooth devices, such as Airpods. Nice when paired with an alfred trigger.
# Taken from https://www.reddit.com/r/MacOS/comments/i4czgu/big_sur_airpods_script/gck3gz3/
# by https://github.com/smithumble
use framework "IOBluetooth"
use scripting additions
set AirPodsName to "AirPods"
on getFirstMatchingDevice(deviceName)
repeat with device in (current application's IOBluetoothDevice's pairedDevices() as list)
@icanhazstring
icanhazstring / .travis.yml
Created February 14, 2019 15:00
Enable Travis PHP Build on Windows
# default os is linux
matrix:
include:
- language: php
php: 7.2
before_script:
- composer install
after_script:
- sh .travis.coverage.sh
@antifuchs
antifuchs / iterm2_zsh_init.zsh
Last active July 15, 2022 15:15
tmux-enabled iterm2 shell integration for zsh.
if [[ -o login ]]; then
TMUX_PREFIX=""
if [[ ! -z "$TMUX" ]] ; then
# Via
# <http://blog.yjl.im/2014/12/passing-escape-codes-for-changing-font.html>:
TMUX_PREFIX='\ePtmux;\e'
TMUX_POSTFIX='\e\\'
fi
# Indicates start of command output. Runs just before command executes.
@stereoscott
stereoscott / random_text.sql
Created June 22, 2014 17:38
PostgreSQL random text function
-- http://www.postgresql.org/message-id/bddc86150908200534p14723ac2vd1ef223af095d822@mail.gmail.com
CREATE OR REPLACE FUNCTION
random_text(INTEGER)
RETURNS TEXT
LANGUAGE SQL
AS $$
SELECT array_to_string(array(
SELECT SUBSTRING('23456789abcdefghjkmnpqrstuvwxyz'
FROM floor(random()*31)::int+1 FOR 1)
@pauloconnor
pauloconnor / gist:4707710
Last active December 1, 2022 09:33
Logstash Mutate Filter for stripping Linux color codes from log files
# Get rid of color codes
mutate {
gsub => ["message", "\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", ""]
}