Skip to content

Instantly share code, notes, and snippets.

Prisacari Dmitrii icamys

Block or report user

Report or block icamys

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@icamys
icamys / gulpfile.js
Last active Dec 29, 2018
Gulp 4 gulpfile.js (assets builder + JSCS + JSHint)
View gulpfile.js
/*jslint node: true */
'use strict';
// ## Globals
var argv = require('minimist')(process.argv.slice(2));
var autoprefixer = require('gulp-autoprefixer');
var changed = require('gulp-changed');
var concat = require('gulp-concat');
var gulp = require('gulp');
var gulpif = require('gulp-if');
View .jshintrc
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
// File is modified by icamys
"maxerr" : 2, // {int} Maximum error before stopping
// Enforcing
"bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
View .jscsrc
{
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
@icamys
icamys / selenium-php-webdriver-cheatsheet.md
Last active Aug 17, 2016 — forked from aczietlow/selenium-php-webdriver-cheatsheet.md
Cheat sheet for using php webdriver (facebook/webdriver).
View selenium-php-webdriver-cheatsheet.md

Webdriver PHP API workthough

  • Open a browser

    # start an instance of firefox with selenium-webdriver
    
    $browser_type = 'firefox'
    $host = 'http://localhost:4444/wd/hub'
    
    $capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);
    
@icamys
icamys / nginx_tarantool_lua.Dockerfile
Last active Jul 6, 2017
Dockerfile: nginx + tarantool upstream module + nginx Lua module (Luajit)
View nginx_tarantool_lua.Dockerfile
# Image includes:
# - nginx
# - nginx_upstream_module (for tarantool)
# - nginx_lua_module (required by luajit)
# - nginx_devel_kit (required by luajit)
# - luajit
# - luarocks
# - lua rock "lua-cjson" (is necessary to work with tarantool response, can be extended with env variable)
FROM alpine:3.4
@icamys
icamys / tarantool_devtools.lua
Last active Aug 10, 2017
Tarantool devtools
View tarantool_devtools.lua
----------------------
-- Development tools
local fiber = require('fiber')
local source_update_fiber_name = 'source_update_fiber'
local M = {}
function string.starts(String,Start)
return string.sub(String,1,string.len(Start))==Start
View gist:a44e681da232105ec8b8e2175c80f4c3
import json
with open('output-test.json') as data_file:
input_records = json.load(data_file)
command = 'INSERT INTO dle_post_video (player_id, post_id, code) VALUES ({values})'
player_snippet = '<iframe src="{url}" width="667" height="370" frameborder="0" allowfullscreen></iframe>'
bulk = []
max_bulk_size = 20
@icamys
icamys / recursive-staircase.go
Created Jan 2, 2018
recursive-staircase solution
View recursive-staircase.go
package main
import (
"fmt"
"bufio"
"os"
"strings"
"strconv"
)
View wp_rest_create_post.sh
# 1. Install this plugin in wordpress:
# https://github.com/WP-API/Basic-Auth
# 2. Create wordpress user with username 'admin' and password 'admin'
# 3. Download an image and save it as 'google.jpg'
# 4. Upload image to wordpress REST API
curl \
-H "cache-control: no-cache" \
@icamys
icamys / DuskServeCommand.php
Created Apr 12, 2018
Serve the laravel application and run Dusk tests
View DuskServeCommand.php
<?php
namespace App\Console\Commands;
use RuntimeException;
use Laravel\Dusk\Console\DuskCommand;
use Symfony\Component\Process\Process;
class DuskServeCommand extends DuskCommand
{
You can’t perform that action at this time.