Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
pet the duck until exploded

Oleg Abrazhaev seyfer

💭
pet the duck until exploded
View GitHub Profile
View snippet of package.json scripts
"scripts": {
"serve": "vue-cli-service serve",
"build:admin": "rimraf vue.config.js && copy vue.configAdmin.js vue.config.js && vue-cli-service build --dest dist/admin src/admin/main.js && rimraf vue.config.js && copy vue.configDefault.js vue.config.js",
"build:client": "rimraf vue.config.js && copy vue.configClient.js vue.config.js && vue-cli-service build --dest dist/client src/client/main.js && rimraf vue.config.js && copy vue.configDefault.js vue.config.js",
"lint": "vue-cli-service lint"
},
@seyfer
seyfer / gource.sh
Last active Nov 18, 2020 — forked from cgoldberg/gource.sh
Gource - Mir development video
View gource.sh
# install bzr and gource
# get a branch of Mir's trunk code
# create gource video
$ sudo apt-get install bzr gource
$ bzr branch lp:mir
$ cd mir
$ gource \
-s .06 \
@seyfer
seyfer / use-v-tooltip.vue
Last active Feb 19, 2020
Do not show v-tooltip for touch devices
View use-v-tooltip.vue
function isTouchDevice() {
const prefixes = ' -webkit- -moz- -o- -ms- '.split(' ');
const mq = function(query) {
return window.matchMedia(query).matches;
};
if (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
return true;
}
// include the 'heartz' as a way to have a non matching MQ to help terminate the join
// https://git.io/vznFH
@seyfer
seyfer / feature-detect flexbox.js
Created Oct 23, 2018 — forked from davidhund/feature-detect flexbox.js
The simplest feature-detect for flexbox?
View feature-detect flexbox.js
/*
* Trying to feature-detect (very naive)
* CSS Flexbox support.
* - Only most modern syntax
*
* Is this nonsense?
*/
(function NaiveFlexBoxSupport(d){
var f = "flex", e = d.createElement('b');
@seyfer
seyfer / apn-server.php
Last active Oct 11, 2017 — forked from samvermette/apn-server.php
Quickly send an Apple Push Notification using PHP
View apn-server.php
<?php
$apnsHost = 'gateway.sandbox.push.apple.com';
$apnsCert = 'ck.pem';
$apnsPort = 2195;
$apnsPass = '<PASSWORD_GOES_HERE>';
$token = '<DEVICE_TOKEN_GOES_HERE>';
$payload['aps'] = array('alert' => 'Oh hai!', 'badge' => 1, 'sound' => 'default');
$output = json_encode($payload);
@seyfer
seyfer / knight-moves.js
Created Mar 9, 2017
Toptal Codility Problem: Can Knight reach square?
View knight-moves.js
'use strict';
function getNextPositions(start) {
var moves = [
{ x: -2, y: -1 },
{ x: -2, y: +1 },
{ x: -1, y: -2 },
{ x: -1, y: +2 },
{ x: +1, y: -2 },
{ x: +1, y: +2 },
@seyfer
seyfer / negabase.php
Created Mar 9, 2017 — forked from CMCDragonkai/negabase.php
PHP: Negative Base Conversion from Base 10 Decimal
View negabase.php
<?php
/**
* Negabase
* To convert a decimal to negative base.
* Divide the number by the negative base.
* Acquire the whole number quotient and remainder.
* If the remainder is negative, add 1 to the quotient and add the absolute value of the base to the remainder.
* Divide the quotient by the negative base... rinse and repeat until the quotient is 0.
* Aggregate the remainders in reverse (as a stack), and you have your negative base representation.
@seyfer
seyfer / ant-composer.xml
Created Sep 25, 2015 — forked from cpliakas/ant-composer.xml
Apache Ant tagets for Composer commands.
View ant-composer.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="Composer Targets" default="build">
<property name="builddir" value="${basedir}/build"/>
<property name="composer" value="${builddir}/composer.phar"/>
<target name="php-check">
<condition property="php" value="php">
<not>
<isset property="${php}"/>
@seyfer
seyfer / gist:2b9b9afb0fe556ad273e
Created Sep 25, 2015 — forked from snipe/gist:4256150
Apache Ant build.xml file for PHPUnit+Jenkins+Ant+Symfony2
View gist:2b9b9afb0fe556ad273e
<?xml version="1.0" encoding="UTF-8"?>
<!-- Set some basic project information and targets -->
<project name="My Symfony2 Project" default="build">
<target name="build"
depends="prepare, vendors, dbupdate, fixtures, lint, phploc, phpmd, phpcpd, phpcs, phpunit"/>
<target name="build-parallel"
depends="prepare, vendors, dbupdate, fixtures, lint, tools-parallel, phpcpd, phpunit"/>
@seyfer
seyfer / byzanz-record-window-gui
Created Mar 18, 2015
byzanz-record-window-gui
View byzanz-record-window-gui
#!/bin/bash
# AUTHOR: (c) Rob W 2012, modified by MHC (http://askubuntu.com/users/81372/mhc)
# NAME: GIFRecord 0.1
# DESCRIPTION: A script to record GIF screencasts.
# LICENSE: GNU GPL v3 (http://www.gnu.org/licenses/gpl.html)
# DEPENDENCIES: byzanz,gdialog,notify-send (install via sudo add-apt-repository ppa:fossfreedom/byzanz; sudo apt-get update && sudo apt-get install byzanz gdialog notify-osd)
# Time and date
TIME=$(date +"%Y-%m-%d_%H%M%S")