Skip to content

Instantly share code, notes, and snippets.

View eSlider's full-sized avatar

Andrey Oblivantsev eSlider

View GitHub Profile
@eSlider
eSlider / spatialite_example.go
Created August 26, 2019 18:53 — forked from ptrv/spatialite_example.go
SpatiaLite example in Go
package main
import (
"database/sql"
"github.com/mattn/go-sqlite3"
"log"
"os"
)
func runQuery(db *sql.DB, query string) {
@eSlider
eSlider / get-org-name-by-host-name.sh
Created August 25, 2019 20:05
Get organisation name by hostname
#!/bin/sh
whois $(dig +short @1.1.1.1 produktor.io | head -1) | grep -Po "org-name\:\s+\K.+"
@eSlider
eSlider / stop-cpu-throttling.sh
Last active June 23, 2020 08:01
Fix broken DC cable connection and CPU throttling for HP Spectre x360
#!/bin/sh
# Determinate CPU capabilities
MAX_CPU=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq)
MIN_CPU=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq)
# Install MSR tools and Linux tools to get hack BIOS
# apt install -y msr-tools linux-tools-common linux-tools-$(uname -r)
@eSlider
eSlider / getThisFuckingObject.js
Last active July 20, 2018 22:16
Get over HTTPS
/**
* Get this fucking object
*
* @param {String} url URL я для http не учитывал
* @param {Function} onData(data) колбэк когда всё норм, будет вызван с уже готовым объектом
* @return {*}
*/
function getThisFuckingJsonObject(url, onData) {
let chunks = [];
return require('https').get(url, res => {
@eSlider
eSlider / build-cpay-lin.sh
Created July 16, 2018 12:48
Build cPay for linux
#!/bin/sh
# Requires:
# PPA="ppa:bitcoin/bitcoin"
# PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev"
unset CC
unset CXX
unset DISPLAY
<?php
namespace Mapbender\ConfiguratorBundle\Controller;
use FOM\ManagerBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
/**
* Mapbender application management
*
* @Route("configurator/")
@eSlider
eSlider / field-constrains.yaml
Created September 27, 2016 07:27
Feature types definition
oprators:
numeric: ['<','>','==']
boolean: ['<>','==']
date: ['bettwen','==','<','>']
string: ['LIKE','NOT LIKE', 'RLIKE', 'LLIKE']
featureTypes:
- id: 1
name: IPE
table: ipe
@eSlider
eSlider / xml-translations-to-yaml.php
Created May 24, 2016 15:02
Converts XML translations to YAML
<?php
require "../vendor/autoload.php";
use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;
use Symfony\Component\Yaml\Yaml;
use Wheregroup\XML\Util\Parser as XMLParser;
$finder = new Finder();
$finder->files()->in("../mapbender/src/Mapbender/ManagerBundle/Resources/translations");
@eSlider
eSlider / Power.java
Created May 16, 2016 18:32
Power.java
import java.util.Scanner;
import java.util.InputMismatchException;
public class Power
{
public static int hoch(int x, int y)
{
int result;
if ( y > 0 ) {
result = x * hoch(x, y-1);
<?php //version pg202
//set allowTestMenu to false to disable System/Server test page
$allowTestMenu = true;
header("Content-Type: text/plain; charset=x-user-defined");
error_reporting(0);
set_time_limit(0);
function phpversion_int()