Skip to content

Instantly share code, notes, and snippets.

View yariksheptykin's full-sized avatar

Iaroslav Sheptykin yariksheptykin

View GitHub Profile
@yariksheptykin
yariksheptykin / gist:3749495
Created September 19, 2012 12:57
Landmarks in Bürgerpark, Bremen
$landmarks = array( );
$landmarks['infrastructure'] = "ST_geomFromText('MULTIPOINT(".
' 8.824747 53.084668'. // entry 'Am Stern'
', 8.828266 53.087736'. // entry 'Benquestraße'
', 8.835239 53.097181'. // entry 'Busestraße'
', 8.838984 53.102476'. // entry 'Zur Munte'
', 8.841419 53.106302'. // entry 'Achterstraße'
', 8.837911 53.114874'. // entry 'Hochschulring'
', 8.823985 53.106843'. // entry 'Findorffallee-Nord'
', 8.825154 53.103745'. // entry 'Findorffallee-Brücke'
@yariksheptykin
yariksheptykin / MainActivity.java
Created May 2, 2014 08:03
Flipping three android screens
package de.threeviews.app;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
@yariksheptykin
yariksheptykin / Buergerpark-osm-overpass.txt
Created June 12, 2015 15:17
OSM data for Buergerpark in Bremen via Overpass API
/*
This is an Overpass query that returns OSM nodes found within Buergerpark in Bremen.
You can observe the output of this query at http://overpass-turbo.eu/
*/
way(poly:"53.09046753 8.813695908 53.0908348 8.814554214 53.09112474 8.814296722 53.09236664 8.816737533 53.09391775 8.819521666 53.0947859 8.820996881 53.09535767 8.821763992 53.09550585 8.822278976 53.09727106 8.824081421 53.10011842 8.826656342 53.10085278 8.826838732 53.10136811 8.827064037 53.10210889 8.826034069 53.10292695 8.825583458 53.10458472 8.824308612 53.10626818 8.823248344 53.10686547 8.823831473 53.10739019 8.823796101 53.10792436 8.824111596 53.10873507 8.824399263 53.11012458 8.824287951 53.11058667 8.824391216 53.11089419 8.824580312 53.11029203 8.827179372 53.1089943 8.831387758 53.10740669 8.836980164 53.10596073 8.842057586 53.10584963 8.841742426 53.10535206 8.840912282 53.10149694 8.838179111 53.09883004 8.836247921 53.09582797 8.834145069 53.09278704 8.831934929 53.09064795 8.830325603 53.08850875 8.828630447 53.08594414 8.82
@yariksheptykin
yariksheptykin / magento2-delete-orders.sql
Created May 4, 2016 11:16
Deletes all orders in Magento 2 shop
/** Empties tables containing information about orders. */
START TRANSACTION;
DELETE FROM sales_order WHERE TRUE;
DELETE FROM sales_creditmemo_comment WHERE TRUE;
DELETE FROM sales_creditmemo_item WHERE TRUE;
DELETE FROM sales_creditmemo WHERE TRUE;
DELETE FROM sales_creditmemo_grid WHERE TRUE;
DELETE FROM sales_invoice_comment WHERE TRUE;
DELETE FROM sales_invoice_item WHERE TRUE;
{
"repositories": [
{
"type":"vcs",
"url": "{ABSOLUTE_PATH_TO_REPO}"
}
],
"require": {
"{PACKAGE_NAME}": "dev-{BRANCH_NAME}"
}
@yariksheptykin
yariksheptykin / dif-lines.sh
Created May 31, 2017 12:06
diff range of lines between two files
#!/usr/bin/env bash
# use like bash ./diff-lines.sh 10:20@hallo.cpp 10:20@welt.cpp
# Parse first argument
IFS='@' read lines filename <<< "$1"
IFS=':' read from to <<< "$lines"
declare -A FILE1=(
[filename]=$filename
#!/usr/bin/env bash
# assumuing the file is in toolkit/componetsn/telemetry
TELEMETRY="Telemetry.cpp"
# Get the copy of Telemety
hg revert -r central $TELEMETRY
declare -A COMPARE_FILE_AREAS=(
# Filename => from:to (Telemetry.cpp) | from:to (Filename)
@yariksheptykin
yariksheptykin / raspberry-php.sh
Last active November 25, 2017 20:34
A sample script for building php for pi
# Intro
#
# This script helps to upgrade PHP to 5.6 on raspbian 7 wheezy.
# This legacy raspbian is running on my old raspberry pi which
# does not have the capacity to get an upgrade.
# I had to upgrade PHP from 5.4 to 5.6 after upgrading owncloud
# to 10.x. After upgradeing owncloud it simply refused to start
# up complaining about low PHP version. This PHP build is
# intended to include everything you need to run owncloud.
#
@yariksheptykin
yariksheptykin / gitlab-review-collapse-all.js
Created May 24, 2018 05:47
Collapses all open files on gitlab review page.
document.querySelectorAll(".fa-caret-down").forEach(close => {close.click()});
@yariksheptykin
yariksheptykin / install-composer.sh
Created August 17, 2018 14:52
install-composer oneliner
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer