Skip to content

Instantly share code, notes, and snippets.

View s00d's full-sized avatar
🏠
Working from home

Pavel Kuzmin s00d

🏠
Working from home
View GitHub Profile
@s00d
s00d / playstore_crawler.php
Created May 29, 2017 07:28 — forked from isogram/playstore_crawler.php
Playstore Crawler PHP using Symfony/DomCrawler and GuzzleHttp
<?php
use Cache; // alias from laravel
use Symfony\Component\DomCrawler\Crawler;
use GuzzleHttp\Client;
public function parsePlayStore($url='')
{
$parsedUrl = parse_url($url, PHP_URL_QUERY);
$packageNameFromUrl = 'com.inponsel.android';
export default map => Array.isArray(map)
? map.map(key => ({ key, val: key }))
: Object.keys(map).map(key => ({ key, val: map[key] }))
@s00d
s00d / a_request.js
Last active February 14, 2017 20:51
import qs from 'query-string'
import template from 'string-template'
import isPlainObject from 'lodash/isPlainObject'
import merge from './cheap-merge'
import promisify from './promisify'
const defaultOptions = {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
def move_tower(n, spires):
if n > 0:
move_tower(n - 1, [spires[0], spires[2], spires[1]])
if spires[0]: spires[1].append(spires[0].pop())
move_tower(n - 1, [spires[2], spires[1], spires[0]])
nm = int(10)
spires = [[nm-x for x in range(nm)],[],[]]
class honoiClass {
isValidMove(sIdx, eIdx, startSelect, endSelect) {
if(startSelect > this.state.numDisks - 1 || endSelect < 0) return false;
if (this.state.stacks[sIdx][startSelect] === 0) {
return this.isValidMove(sIdx, eIdx, startSelect + 1, endSelect);
} else if (this.state.stacks[eIdx][endSelect] !== 0) {
if (this.state.stacks[sIdx][startSelect] < this.state.stacks[eIdx][endSelect]) {
return this.isValidMove(sIdx, eIdx, startSelect, endSelect-1);
} else {
<template>
<div class="control">
<label for='tags' class="label" v-if="label" v-text="label"></label>
<div class="input is-flex">
<div class="tags">
<div v-for="tag in tags"
class="tag is-outlined"
:class="[tag.selected ? 'is-warning' : 'is-primary']"
@click="toggleSelect(tag)"
>
<?php
namespace App\Console;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
trait OverlappingControlled
{
@s00d
s00d / AppServiceProvider.php
Created August 20, 2016 00:33
Blade directives to dump template variables.
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
@s00d
s00d / Debug.php
Last active March 15, 2016 23:09
Debug trait
<?php
namespace App;
trait Debug
{
public static function xprint($param, $title = 'Debug information') {
ini_set('xdebug.var_display_max_depth', 50);
ini_set('xdebug.var_display_max_children', 25600);
ini_set('xdebug.var_display_max_data', 9999999999);