- Add all *.ts files from this gist to your project
- Add "./providers/SocketIOProvider" in .adonisrc.json section "providers"
- Add "./start/socket" in .adonisrc.json section "preloads"
- npm i --save socket.io socket.io-redis @types/socket.io
- Add "@types/socket.io" in "types" array tsconfig.json
- Connect to your WS ws://localhost:3333/socket.io
- See your adonis logs when client connect
View MY_URI.php
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 | |
if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
/* Автор: t1myrkq http://habrahabr.ru/users/t1myrkq/ | |
* Это расширение библиотеки URI для COdeigniter, взято мной тут http://habrahabr.ru/post/42172/ | |
* Очень полезная вещь, если делать поиск POST запросом, формировать 301 redirect с адресом: ЧПУ+переменные на хвосте через знак вопроса (как у Get) | |
* Позволяет оставить '$config['enable_query_strings'] = FALSE;'. и принимать GET запросы командой $current_page = $this->uri->getParam(‘page’); | |
* где url /catalog/produnction/?page=2 | |
* Почему не воспользоваться обычным GET? - потому-что при использовании редиректа в начало попадает знак вопроса и портит внешний вид ссылки | |
* Евгений Рюмин - beatlelab@gamil.com | |
* 12.04.2013 |
View gist:864043ba74926224b05d
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
86937 isset | |
43159 echo | |
31697 empty | |
29252 substr | |
26146 count | |
24248 is_array | |
22572 strlen | |
19365 sprintf | |
18090 unset | |
16584 str_replace |
View bootstrap.modal.vue
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> | |
/** | |
* Bootstrap Style Modal Component for Vue | |
* Depend on Bootstrap.css | |
*/ | |
export default { | |
props: { | |
show: { | |
type: Boolean, | |
twoWay: true, |
View VueSelectSimple.vue
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
<template> | |
<div> | |
<div class="select-input" @click="toggle()"> | |
<span>{{label}}</span> | |
<i class="select-arrow" :class="{active: show}"></i> | |
</div> | |
<ul class="dropdown-input" v-show="show"> | |
<li v-for="(key, opt) in options" @click="select(key), show = !show"> |
View YandexMap.vue
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
<template> | |
<div class="col-xs-12" style="padding:0;"> | |
<div class="panel panel-default" style="margin:0;"> | |
<div class="panel-body" style="padding:0;"> | |
<div v-if="maps.length" :style="{height: height + 'px'}" id="map"></div> | |
<h3 v-else class="text-center">Нет точек</h3> | |
</div> | |
</div> | |
</div> | |
</template> |
View replain.vue
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
<template> | |
<div></div> | |
</template> | |
<script> | |
const elementId = 'replain-script' | |
export default { | |
props: { | |
code: { | |
default: null |
View README.md
View README.md
How can you start developing npm package for AdonisJS 5?
It's simple - using mrm preset
- mkdir adonis-package-name && cd mkdir adonis-package-name
- npm init
- npm i --save-dev mrm @adonisjs/mrm-preset
- Add script to package.json file
{
"scripts": {
"mrm": "mrm --preset=@adonisjs/mrm-preset"
View self-signed-private-registry.sh
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
#!/usr/bin/env bash | |
# Installs/Configures: | |
# - Docker | |
# - Docker Registy Container with self-signed cert | |
# | |
# Tested on Ubuntu 14.04.1 | |
# Must be executed with elevated privilages | |
if [ "$(id -u)" != "0" ]; then |
View gist:54259f5f56755fb44e0515cef5c6b252
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
# Localization | |
d-i debian-installer/locale string en_AU | |
# Keyboard | |
# Disable interactive keymap detection. | |
d-i console-setup/ask_detect boolean false | |
d-i keyboard-configuration/layoutcode string us | |
# Network | |
d-i netcfg/choose_interface select auto |