Skip to content

Instantly share code, notes, and snippets.

View acyuta's full-sized avatar
🌐
Digital Nomad

Akim Glushkov acyuta

🌐
Digital Nomad
View GitHub Profile
@acyuta
acyuta / mac-setup-redis.md
Created December 6, 2021 10:19 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
enum Sprites {
HERO_MOVE,
HERO_STAND_UP,
HERO_STAND_DOWN,
}
class Bitmap {}
class Hero {
@acyuta
acyuta / AxiosBuildExample.js
Last active October 10, 2019 08:14
AxiosBuildExample.js
import axios from "axios";
import AuthService from "./service/AuthService";
const headers = {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Credentials": "true"
};
const HTTP = new axios.create({
responseType: "json",
bt2=# SET enable_seqscan = off;
SET
bt2=# explain(analyze, buffers) select distinct serial_number from telemetry;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Unique (cost=0.56..29452499.56 rows=608 width=4) (actual time=1.886..75483.005 rows=874 loops=1)
Buffers: shared hit=68873 read=884486 dirtied=56
-> Index Only Scan using concurently on telemetry (cost=0.56..29347579.02 rows=41968215 width=4) (actual Buffers: shared hit=68873 read=884486 dirtied=56
time=1.884..71989.949 rows=42559723 loops=1)
Heap Fetches: 9134141
public class Public {
public static void main(String[] args) {
Anon ext = new Anon() {
@Override
public void doit() {
System.out.println("Anon");
}
};
ext.doit();
}
@acyuta
acyuta / log.log
Created October 15, 2018 11:00
log.log
17:59:06.223 [background-preinit] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Log4j2LoggerProvider
17:59:06.229 [background-preinit] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 6.0.10.Final
17:59:06.251 [background-preinit] DEBUG org.hibernate.validator.internal.engine.resolver.TraversableResolvers - Found javax.persistence.Persistence on classpath containing 'getPersistenceUtil'. Assuming JPA 2 environment. Trying to instantiate JPA aware TraversableResolver
17:59:06.253 [background-preinit] DEBUG org.hibernate.validator.internal.engine.resolver.TraversableResolvers - Instantiated JPA aware TraversableResolver of type org.hibernate.validator.internal.engine.resolver.JPATraversableResolver.
17:59:06.261 [background-preinit] DEBUG org.hibernate.validator.internal.xml.ValidationXmlParser - Trying to load META-INF/validation.xml for XML based Validator configuration.
17:59:06.263 [background-preinit] DEBUG org.hibernate.validator.internal.xml.ResourceLoade
@acyuta
acyuta / yandex_market_search.php
Created August 29, 2018 14:12
Yandex Market Search PHP
<?php
function req($type, $name='Atcom AT10700', $geoid = 213) {
$encodedname = urlencode($name);
$APIKey = "<yandex_content_api_here>";
$url = "https://api.content.market.yandex.ru/v2/models/match?geo_id=$geoid&name=$encodedname&match_types=$type";
$headers = [
"Host: api.content.market.yandex.ru",
"Accept: */*",
@acyuta
acyuta / yml_parce.php
Last active October 5, 2017 15:21
Yandex Xml Reporter
<?php
/**
* Быстрый отчёт по структуре товаров по XML от Yandex
*
* USING: php yml_parce.php "http://some.site/products_data_for_yandex.xml
*
* User: akim aka [email protected]
* Date: 10/5/17
* Time: 9:27 PM
*/
@acyuta
acyuta / temp.php
Last active November 17, 2016 15:25
<?php
abstract class A {
// .....
public static function prepareDbQuery($sql, $cut_args_array = [])
{
global $wpdb;
return array_map(function ($e) use ($cut_args_array) {
if ($cut_args_array != null)
foreach ($cut_args_array as $arg) unset($e[$arg]);
@acyuta
acyuta / shash.php
Created June 23, 2016 06:18
Simple String Hash Function On PHP
<?php
function e($str, $modul) {
$intLength = strlen($str) / 4;
$sum = 0;
$MUL = 256;
for($j = 0; $j < $intLength; $j++) {
$c = substr($str, $j * 4, 4);
$mult = 1;
for ($k = 0; $k < strlen($c); $k++) {