This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default map => Array.isArray(map) | |
? map.map(key => ({ key, val: key })) | |
: Object.keys(map).map(key => ({ key, val: map[key] })) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)],[],[]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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)" | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console; | |
use Illuminate\Console\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
trait OverlappingControlled | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use Illuminate\Support\Facades\Blade; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
NewerOlder