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
" Specify a directory for plugins | |
call plug#begin('~/.vim/plugged') | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
Plug 'scrooloose/nerdtree' | |
Plug 'Xuyuanp/nerdtree-git-plugin' | |
Plug 'tiagofumo/vim-nerdtree-syntax-highlight' | |
Plug 'ryanoasis/vim-devicons' | |
Plug 'airblade/vim-gitgutter' | |
"Plug 'ctrlpvim/ctrlp.vim' " fuzzy find files |
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
## foreground | |
mongod --config /usr/local/etc/mongod.conf | |
## background | |
mongod --config /usr/local/etc/mongod.conf --fork | |
## check if is running | |
ps -ef | grep mongod |
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
<?php | |
function theme_prefix_kses_allowed_html($tags, $context) { | |
switch($context) { | |
case 'social': | |
$tags = array( | |
'a' => array('href' => array()), | |
'b' => array() | |
); | |
return $tags; | |
default: |
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
var str = 'Travellyte - Travel Travel Travel hotwheels PSD Template WordPress'; | |
var r = /[^\w_]+/g | |
arr = str.replace(r, ' ').toLowerCase().split(" "); | |
var t = arr.reduce((acc, current, idx) => { | |
acc.push({ terms: current }); | |
return acc; | |
}, []) |
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
async function findItemTitle( | |
searchTerm, | |
category, | |
fuzzy = false | |
) { | |
let { total_hits } = await fetch( | |
`url` | |
) | |
.then(r => r.json()) | |
.then(r => r); |
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 PubSub { | |
constructor() { | |
this.events = {}; | |
} | |
subscribe(event, callback) { | |
let index; | |
if (!this.events[event]) { | |
this.events[event] = []; | |
} |
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
<script> | |
import Form from './Form.svelte'; | |
let users = [ | |
{id: 0, name: 'ivor'}, | |
{id: 1, name: 'pad'} | |
]; | |
</script> | |
<Form users={users}/> |
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
SET | |
@meta_id :=( | |
SELECT | |
meta_value | |
FROM | |
wp_posts, | |
wp_postmeta | |
WHERE | |
wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.post_id = 146 AND meta_key = '_audio_file_id' | |
); |
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
-- imdb dataset | |
SELECT | |
title, | |
year, | |
GROUP_CONCAT(country) as 'countries', | |
COUNT(country) as 'country_count' | |
FROM `movies` | |
INNER JOIN `countries` | |
ON movies.`movieid` = countries.`movieid` | |
GROUP BY title |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.