Skip to content

Instantly share code, notes, and snippets.

@bandicoot86
bandicoot86 / Autowired.java
Created June 2, 2019 08:19
Autowired Annotations
package com.example.demo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SimpleSpringApplication {
@bandicoot86
bandicoot86 / SelfBean.java
Last active June 1, 2019 05:56
SelfBean.java
package com.example.demo;
public class SelfManagedBean {
private final Bean1 b1;
private final Bean2 b2;
public SelfManagedBean() {
this.b1 = new Bean1();
this.b2 = new Bean2();
@bandicoot86
bandicoot86 / Example.java
Created June 1, 2019 05:34
ExampleSpring.java
package com.example.demo;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SimpleSpringApplication {
public static void main(String[] args) {
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
{
"key_id": 3,
"contacts": [
{
"external_id": "[email protected]",
"data": {
"global": {
"CustomerName": "Anton",
"OrderId": "123",
"OrderPhone": "999 999 99 99",
cat /etc/gdm3/custom.conf
echo $XDG_SESSION_TYPE
// a list of useful queries for profiler analysis. Starting with the most basic.
// 2.4 compatible
//
// output explained:
//
{
"ts" : ISODate("2012-09-14T16:34:00.010Z"), // date it occurred
"op" : "query", // the operation type
"ns" : "game.players", // the db and collection
2018-03-28 13:27:29,846 INFO [nio-8080-exec-1] ru.kupivip.kng.service.classifier.ClassifierService : Class parent keys null [email protected]
2018-03-28 13:27:29,872 INFO [nio-8080-exec-1] ru.kupivip.kng.service.classifier.ClassifierService : Class parent keys [160] [email protected]
2018-03-28 13:27:29,899 INFO [nio-8080-exec-1] ru.kupivip.kng.service.classifier.ClassifierService : Class parent keys [392] [email protected]
2018-03-28 13:27:29,909 INFO [nio-8080-exec-1] ru.kupivip.kng.service.classifier.ClassifierService : Class parent keys [394] [email protected]
2018-03-28 13:27:29,917 INFO [nio-8080-exec-1] ru.kupivip.kng.service.classifier.ClassifierService : Class parent keys [400] [email protected]
2018-03-28 13:27:29,922 INFO [nio-8080-exec-1] ru.kupivip.kng.service.classifier.ClassifierService : Class parent keys [404] [email protected]
2018-03-28 13:27:29,928
{
"brand": {
"oodji": 69815896,
"Ringspun": 328,
"Replay": 656,
"GIORGIO DI MARE": 328
},
"categories": {
"Для дома": 127,
"Женщинам": 3,
@bandicoot86
bandicoot86 / ThinkLight
Created February 4, 2018 14:33 — forked from vzaliva/ThinkLight
This script controll keyboard backlight on IBM ThinkPad X-series
#!/bin/bash
# Vadim Zaliva [email protected]
# based on https://gist.github.com/hadess/6847281
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi