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 sf | |
{ | |
/** | |
* Make readable text|html from array | |
* | |
* Example: | |
* $data = [1,2,3]; | |
* $pattern = ['(',', ',')']; | |
* sf::mergeWithPattern($data, $pattern) | |
* // '(1, 2, 3)' |
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
function ngroka() { | |
if [[ "$1" ]] | |
then | |
ngrok -authtoken YOUR_TOKEN -subdomain $1 80 | |
else | |
echo "Error: missing required parameter." | |
echo "Usage: ngrok subdomain" | |
fi | |
} |
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 | |
$folders = [ | |
// 'admin', | |
// 'boards', | |
'cgi-bin', | |
// 'cron', | |
// 'css', | |
// 'helpers', |
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 BackupOldTables extends Migration | |
{ | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ |
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
<table> | |
<tr> | |
<td>Varying</td> | |
<td>number</td> | |
<td>of</td> | |
<td>columns</td> | |
</tr> | |
<tr> | |
<td colspan="42">One row to rule them all</td> | |
</tr> |
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> | |
<select name="name" class="form-control" v-model="value"> | |
<option :value="null" :selected="value === null">{{noProgrammer}} | |
</option> | |
<option v-for="(user_id, user_name) in apiProgrammers.data" | |
:value="user_id" :selected="value == user_id" | |
v-text="user_name"></option> | |
</select> | |
</template> |
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
function registerComponents (Vue, components) { | |
for (var index in components) { | |
Vue.component(index, components[index]); | |
} | |
}; | |
function registerPartials (Vue, partials) { | |
for (var index in partials) { | |
Vue.partial(index, partials[index]); | |
} |
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
Here's the usage example: | |
<vm-recaptcha :value.bind="form.recaptcha"></vm-recaptcha> | |
And you have to include cdn as always. This gist doesn't cover serverside. | |
<template> | |
<div :id="id" value=""></div> | |
</template> | |
<script> |
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
import _ from 'lodash' | |
module.exports = function (Vue){ | |
// Глобальные миксины. | |
Vue.mixin({ | |
props: { | |
id: { | |
default: function (){ | |
var component_name = _.kebabCase(this.constructor.name); |
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="flag-container col-sm-12"> | |
<div class="flag-icon" @click="clean"> | |
<i class="fa fa-globe fa-2x"></i> | |
</div> | |
<template v-for="(id, selected) in countries"> | |
<div class="flag-icon" | |
:selected="selected" | |
@click="toggleCountry(id)"> | |
<vm-country-icon :country="id"></vm-country-icon> |
OlderNewer