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
<select2 | |
v-model="something" | |
:options="[{ id: 1, text: '', selected: true }]" | |
multiple | |
placeholder | |
></select2> |
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 { EOL } from 'os'; | |
interface LoggerInterface { | |
error(message: string): string | |
info(message: string): string | |
} | |
class Logger implements LoggerInterface { | |
adapter = null |
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
class Http { | |
static send(method, url) { | |
const request = new Request(url, {method}) | |
return fetch(request) | |
.then(response => response.json()) | |
.then(json => json) | |
} |
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/sh | |
#---------------------------------------------------------------------------------------- | |
# It works! | |
# https://steamcommunity.com/discussions/forum/2/282992646978253149/#c282992646985999495 | |
#---------------------------------------------------------------------------------------- | |
USER=$(whoami) | |
cd /Users/${USER}/Library/Application\ Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/public; ls *.res | while read line ; do file=$(echo $line | tr '[:upper:]' '[:lower:]'); mv $line $file; done | |
cd /Users/${USER}/Library/Application\ Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/steam/cached/; ls *.res | while read line ; do file=$(echo $line | tr '[:upper:]' '[:lower:]'); mv $line $file; done |
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
-- hattip https://github.com/lodestone/hyper-hacks | |
-- hattip https://gist.github.com/ttscoff/cce98a711b5476166792d5e6f1ac5907 | |
-- A global variable for the sub-key Hyper Mode | |
k = hs.hotkey.modal.new({}, 'F18') | |
-- Hyper+key for all the below are setup somewhere | |
-- The handler already exists, usually in Keyboard Maestro | |
-- we just have to get the right keystroke sent |
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
-- A global variable for the Hyper Mode | |
k = hs.hotkey.modal.new({}, "F17") | |
-- Trigger existing hyper key shortcuts | |
k:bind({}, 'm', nil, function() hs.eventtap.keyStroke({"cmd","alt","shift","ctrl"}, 'm') end) | |
-- OR build your own | |
launch = function(appname) |
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
#!/usr/bin/env sh | |
# Laravel Homestead v3 and v4 are sucks! | |
# They removes useful commands like "homestead up" or "homestead ssh" from v2. | |
# Here is "homesteak", simple script to bring back those commands. | |
# Set composer directory. | |
if [ ! $COMPOSER_HOME = '' ]; then | |
COMPOSER_DIRECTORY="$COMPOSER_HOME"; | |
elif [ ! $XDG_CONFIG_HOME = '' ]; then |
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
s_id=`curl -X POST http://127.0.0.1:4444/wd/hub/session -d '{"desiredCapabilities":{"browserName":"firefox","platform":"MAC"}}'|awk -F'"' '{print $6}'` | |
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/url -d '{"url":"http://www.google.com"}' | |
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element -d '{"using":"id","value":"gbqfq"}' | |
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element/0/value -d {"value":["selenium"]} | |
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element -d '{"using":"id","value":"gbqfb"}' | |
curl -X POST http://127.0.0.1:4444/wd/hub/session/$s_id/element/1/click | |
curl -X DELETE http://127.0.0.1:4444/wd/hub/session/$s_id/window |
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
#!/usr/bin/env php | |
<?php | |
define('PID_PATH', '/tmp/myapp.pid'); | |
define ('PID', (int) file_get_contents(PID_PATH)); | |
if (empty($argv[1])) { | |
echo <<<INFO |
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
server { | |
listen 80; | |
server_name mydomain.com www.mydomain.com; | |
location / { | |
rewrite ^(.*)$ https://$server_name$1 permanent; | |
} | |
} |