Skip to content

Instantly share code, notes, and snippets.

View asvae's full-sized avatar

Yauheni Prakopchyk asvae

View GitHub Profile
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]);
}
<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>
@asvae
asvae / colspan_max
Created September 13, 2015 15:45
Maximized colspan
<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>
@asvae
asvae / gist:524afebb9dc7aec6e38e
Created July 10, 2015 11:22
Laravel database backup migration
class BackupOldTables extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
<?php
$folders = [
// 'admin',
// 'boards',
'cgi-bin',
// 'cron',
// 'css',
// 'helpers',
@asvae
asvae / gist:0e7dc5ce2fcba996995e
Created April 3, 2015 14:58
Ngrok nginx bash alias
function ngroka() {
if [[ "$1" ]]
then
ngrok -authtoken YOUR_TOKEN -subdomain $1 80
else
echo "Error: missing required parameter."
echo "Usage: ngrok subdomain"
fi
}
@asvae
asvae / Array to HTML converter
Last active August 29, 2015 14:17
Readable HTML from array and pattern (mergeWithPattern)
class sf
{
/**
* Make readable text|html from array
*
* Example:
* $data = [1,2,3];
* $pattern = ['(',', ',')'];
* sf::mergeWithPattern($data, $pattern)
* // '(1, 2, 3)'