This file contains hidden or 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 | |
| set -eu | |
| SYSCTL_FILE=/etc/sysctl.d/90-tcp-bbr.conf | |
| # check root | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "This script must be run as root" | |
| exit 1 | |
| fi |
This file contains hidden or 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
| -- Inspired by https://github.com/jasoncodes/dotfiles/blob/master/hammerspoon/control_escape.lua | |
| -- You'll also have to install Karabiner Elements and map caps_lock to left_control there | |
| len = function(t) | |
| local length = 0 | |
| for k, v in pairs(t) do | |
| length = length + 1 | |
| end | |
| return length | |
| end |
This file contains hidden or 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
| -- Karabiner-Elements の設定 | |
| -- From key To key | |
| -- grave_accent_ant_tilde (`) f16 | |
| -- PCキーボードの無変換キー 英数キー | |
| -- PCキーボードの変換キー かなキー | |
| -- left_command left_option | |
| -- left_control left_command | |
| -- left_option left_control | |
| -- right_command right_option | |
| -- right_control right_command |
This file contains hidden or 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
| ctrl_table = { | |
| sends_escape = true, | |
| last_mods = {} | |
| } | |
| control_key_timer = hs.timer.delayed.new(0.15, function() | |
| ctrl_table["send_escape"] = false | |
| -- log.i("timer fired") | |
| -- control_key_timer:stop() | |
| end |
This file contains hidden or 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
| brew reinstall ffmpeg --with-faac # Needs ffmpeg with faac encoder | |
| ffmpeg -i <input.mp3> -ac 1 -ab 128000 -f mp4 -acodec libfaac -y -ss <beggining_second> -t <length_in_seconds> ringtone.m4r # Length can't be higher than 40 seconds |
This file contains hidden or 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
| import * as mongoose from 'mongoose'; | |
| export let Schema = mongoose.Schema; | |
| export let ObjectId = mongoose.Schema.Types.ObjectId; | |
| export let Mixed = mongoose.Schema.Types.Mixed; | |
| export interface IHeroModel extends mongoose.Document { | |
| name: string; | |
| power: string; |
This file contains hidden or 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
| -- written by Florian Bender, 2015 | |
| -- based on work by Michael Wyszomierski <https://wysz.com/wyszdom/2009/06/simple-sleep-timer-with-applescript/> | |
| -- license: Public Domain / CC0 <http://creativecommons.org/publicdomain/zero/1.0/> | |
| tell application "System Events" | |
| set volumeSettings to get volume settings | |
| set volumeValue to (output volume of volumeSettings) | |
| set fadeTime to 10 -- time in seconds for fade change | |
| set fadeChange to (volumeValue div fadeTime) | |
| -- display alert "Volume: " & volumeValue & ", Delta: " & fadeChange | |
| display dialog "Sleep time (min):" default answer "25" |
This file contains hidden or 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
| #8C1AFF,#6212B3,#FFFFFF,#8C1AFF,#6212B3,#FFFFFF,#29CC6D,#FF6040 |
This file contains hidden or 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
| (* | |
| Export All Safari Tabs in All Open Windows to a Markdown File | |
| July 13, 2015 | |
| // SCRIPT PAGE | |
| http://hegde.me/urlsafari | |
| // ORIGINAL SCRIPT ON WHICH THIS SCRIPT IS BUILT | |
| http://veritrope.com/code/export-all-safari-tabs-to-a-text-file |
This file contains hidden or 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
| display dialog "Name of the browser?" default answer "Safari" | |
| set inp to text returned of result | |
| tell application "System Events" | |
| if inp is "Google Chrome" then | |
| tell application "Google Chrome" to return URL of active tab of front window | |
| else if inp is "Safari" then | |
| tell application "Safari" to return URL of front document | |
| else if inp is "Firefox" then | |
| tell application "Firefox" to activate |