Skip to content

Instantly share code, notes, and snippets.

View emyasnikov's full-sized avatar

Evgenij 'Warl' Myasnikov emyasnikov

  • Germany
View GitHub Profile
@emyasnikov
emyasnikov / import.js
Created June 19, 2019 12:19
Allows to dynamically import required JS files before callback will be called. Those JS files are cached and won't be requested and loaded twice.
(function ($) {
var imported = {};
var file = $("script").last().attr("src");
var path = file.substr(0, file.lastIndexOf("/") + 1);
$.script = function (url, options) {
options = $.extend(options || {}, {
dataType: "script",
cache: true,
url: url,
});
@emyasnikov
emyasnikov / request.js
Last active July 24, 2019 10:31
Requests Drupal 7 Services token automatically, saves it to local storage and allows to use jQuery.request() function without to worry about whether token is still valide or has to be requested again.
(function ($) {
var token, request = null;
$.token = function () {
return $.get("/services/session/token").done(function (data) {
localStorage.setItem("X-CSRF-Token", data);
token = data;
});
};
$.request = function (settings, deferred) {
var response = deferred || $.Deferred();
@emyasnikov
emyasnikov / install_libsass.sh
Last active July 7, 2019 11:08 — forked from feryardiant/install_libsass.sh
Easy way to Install libsass & sassc in Ubuntu, `curl -sSL https://git.io/fji3v | sudo bash`
#!/bin/bash
# Based on https://gist.github.com/edouard-lopez/503d40a5c1a49cf8ae87
set -e
# Installing dependencies
apt-get -q -y install build-essential automake libtool git
buildDir="/tmp/sass-build"
@emyasnikov
emyasnikov / raspbian-stretch-lite-slimdown.md
Created February 4, 2021 20:52 — forked from hhromic/raspbian-stretch-lite-slimdown.md
Slimming Down Raspbian Stretch Lite

Slimming Down Raspbian Stretch Lite

Notes for slimming down a fresh installation of Raspbian Stretch Lite. This guide does not strip Raspbian of basic functionality such as Bluetooth and mDNS.

Instructions

Install a fresh Raspbian Stretch Lite image into the SD card ([source][1]).

$ unzip -p 2018-04-18-raspbian-stretch-lite.zip | dd bs=4M of=/dev/sdX conv=fsync

@emyasnikov
emyasnikov / v-data-table-with-handle.vue
Created February 5, 2021 16:20 — forked from abhaywawale/v-data-table-with-handle.vue
Where user can select the text and interact with the table
<template>
<v-container fluid>
<v-layout align-start justify-center>
<v-data-table :headers="headers" :items="desserts" hide-actions class="elevation-2">
<template slot="items" slot-scope="props">
<td class="handle" style="max-width: 28px;">::</td>
<td>{{ props.item.name }}</td>
<td class="text-xs-right">{{ props.item.calories }}</td>
<td class="text-xs-right">{{ props.item.fat }}</td>
<td class="text-xs-right">{{ props.item.carbs }}</td>
@emyasnikov
emyasnikov / gist:867c8318f2166c9c7b044f0f0a9aa972
Created March 10, 2021 11:41 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@emyasnikov
emyasnikov / gitflow-breakdown.md
Created April 14, 2021 14:00 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@emyasnikov
emyasnikov / auth.php
Created April 29, 2021 09:47 — forked from pretzelhands/auth.php
German Language files for Laravel 5.4
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used during authentication for various
@emyasnikov
emyasnikov / Kernel.php
Last active July 29, 2021 09:00 — forked from phillipsharring/Kernel.php
Laravel Artisan command to perform MySQL Dump using database connection information in the .env file. Forked from https://gist.github.com/kkiernan/bdd0954d0149b89c372a
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
@emyasnikov
emyasnikov / .gitconfig
Created March 26, 2023 20:53
Git command to remove gone branches
[alias]
gone = ! "git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs -r git branch -D"