Skip to content

Instantly share code, notes, and snippets.

@stillfinder
stillfinder / textarea_insert_at.vue
Created August 7, 2020 07:39
Insert text in cursor position in textarea
<template>
<div>
<textarea ref="body" class="form-input" @input="handleInput" @click="handleInput" v-model="content"></textarea>
<div>{{ position}}</div>
<button class="button" @click="insertWtf">Insert '<-WTF->'</button>
</div>
</template>
<script>
export default {
@stillfinder
stillfinder / self_vs_static.php
Last active November 5, 2022 15:21
Self vs Static in PHP
<?php
class Animal
{
public static $name = "animal";
// Return the class that is represented by "self::"
public function getSelfClass()
{
return get_class();
@stillfinder
stillfinder / vue.error
Created December 18, 2019 09:45
Vue error
<p><code>&lt;input class="form-input" id="tags" placeholder="Enter tags separated by comma." name="tags" type="text"</code></p>
<p><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value="{{ $tags ?? old('tags') ?? '' }}"&gt;</code></p>
@stillfinder
stillfinder / gist:8b2a086f0617a6a77ba9c6aa127bfab8
Created December 17, 2019 13:42 — forked from nebadon2025/gist:3143d837350ab443482b0f5a6faccd6b
Full Screen Youtube Autoplay URL format
https://www.youtube.com/embed/HH0zOJVOzxs?rel=0&amp;autoplay=1;fs=0;autohide=0;hd=0;
@stillfinder
stillfinder / Preferences.sublime-settings
Last active June 10, 2019 16:45
Sublime Text Settings
{
"close_windows_when_empty": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"downloader_precedence":
{
"linux":
[
"urllib",
"curl",
"wget"
@stillfinder
stillfinder / Default (OSX).sublime-keymap
Created June 10, 2019 13:10
My sublime text key bindings
[
{ "keys": ["super+d"], "command": "duplicate_line" },
{ "keys": ["super+shift+d"], "command": "find_under_expand" },
// PHP Companion
{ "keys": ["alt+e"], "command": "expand_fqcn" },
{ "keys": ["shift+f6"], "command": "expand_fqcn", "args": {"leading_separator": true} },
{ "keys": ["alt+i"], "command": "find_use" },
{ "keys": ["f4"], "command": "import_namespace" },
// { "keys": ["f3"], "command": "implement" },
@stillfinder
stillfinder / .php_cs
Last active June 10, 2019 16:40
PHP CS Fixer Laravel configuration
<?php
$finder = PhpCsFixer\Finder::create()
->notPath('bootstrap/cache')
->notPath('storage')
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true)
@stillfinder
stillfinder / ETB_add_widget.html
Created May 30, 2019 09:42
Add ETB widget to your site
<script src='https://english-testing-bot.net.ua/js/etbwidget.js'></script>
<script src='https://english-testing-bot.net.ua/js/widget.js'></script>
@stillfinder
stillfinder / Run command from url
Created January 18, 2019 08:14
run_command_from_url.sh
bash <(curl -s https://gist.githubusercontent.com/stillfinder/d35cd54805105a4a8e4aed8b019afaae/raw/20ff2cbb5b87a6ad8edec443130a176f2ba4811b/uninstall_mysql_script.sh)
@stillfinder
stillfinder / brew_install_mysql.sh
Last active January 17, 2019 22:20
Brew install MySql
brew update && brew install mysql@5.7
# or you can use 'brew install mysql' to install the latest version of MySql