Skip to content

Instantly share code, notes, and snippets.

@7u4
7u4 / 00-ubuntu-intellij-macosx.md
Created April 25, 2021 06:14 — forked from ingramchen/00-ubuntu-intellij-macosx.md
Use ubuntu/Intellij like macOS X

How to mimic full macOS Intellij behavior in Ubuntu

  • Enviroment
    • Ubuntu 20.04
    • Intellij IDEA 2020

Ubuntu gnome shell shortcuts

@7u4
7u4 / FileUtil.java
Created April 17, 2021 07:19 — forked from suweya/FileUtil.java
OkHttp download file by Okio
import android.os.Environment;
import android.support.annotation.NonNull;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.TimeUnit;
@7u4
7u4 / codersX-culture.md
Created October 15, 2020 05:29 — forked from nhim175/codersX-culture.md
Văn hoá CodersX team

Văn hoá CodersX

CodersX là một. Chúng ta hoạt động vì một mục đích duy nhất: Thay đổi thế giới một cách tích cực, bắt đầu bằng việc tạo nên một nền giáo dục miễn phí.

Vision

  1. Thay đổi thế giới ← 2. Cùng nhau làm các startup có ảnh hưởng tích cực tới cuộc sống xung quanh ← 1. Làm mới hệ thống giáo dục ← 0. Giúp tất cả mọi người tiếp cận với lập trình

Giúp đỡ các thành viên trong team

Một team chỉ mạnh khi tất cả mọi người support lẫn nhau, và cùng nhau làm việc vì một mục tiêu duy nhất. Nếu chỉ nghĩ đến bản thân thì một lúc nào đó team sẽ tan rã (nếu nhiều người cùng nghĩ về bản thân), hoặc tự loại mình ra khỏi team.

Nghĩ tới người xung quanh

@7u4
7u4 / README.md
Created July 31, 2019 13:16 — forked from sebastianwebber/README.md
Compilation of the Uber Facts on PostgreSQL to MySQL Migration

Uber facts

Original posts/information

Key points

  • ~50GB MySQL Application
  • Main motivation: PostGis
  • Migration made with a custom tool(xml2pgcopy) and mysqldump on 45min
@7u4
7u4 / UUIDUtils.java
Created March 12, 2019 02:26
sequential UUID using current time.Based on https://blog.2ndquadrant.com/sequential-uuid-generators/
import java.nio.ByteBuffer;
import java.security.SecureRandom;
import java.time.Instant;
import java.util.UUID;
public final class UUIDUtils {
private static final int UUID_LENGTH = 16;
private static final int DEFAULT_INTERVAL_LENGTH = 60;
private static final int DEFAULT_INTERAVL_COUNT = 65536;
private static volatile SecureRandom numberGenerator = null;
@7u4
7u4 / pfxtosnk.cs
Created February 22, 2019 12:00 — forked from baywet/pfxtosnk.cs
sample on how to convert a pfx to snk visual studio assembly signing certificate
X509Certificate2 cert = new X509Certificate2(@"KEY.pfx", "pfxPassword", X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
RSACryptoServiceProvider provider = (RSACryptoServiceProvider) cert.PrivateKey;
byte[] array = provider.ExportCspBlob(!provider.PublicOnly);
using (FileStream fs = new FileStream("FileName.snk", FileMode.Create, FileAccess.Write))
{
fs.Write(array, 0, array.Length);
}
@7u4
7u4 / BoxService.cs
Created February 19, 2019 07:48 — forked from allenmichael/BoxService.cs
Example for multiput upload in a simple Console Application
using System;
using System.IO;
using Box.V2;
using Box.V2.Config;
using Box.V2.JWTAuth;
namespace BoxPlayground
{
public static class BoxService
{

Theming Ant Design with Sass and Webpack

This is a solution on how to theme/customize Ant Design (which is written in Less) with Sass and webpack. Ant itself offers two solutions and a related article on theming, but these are only applicable if you use Less, the antd-init boilerplate or dva-cli.

What this solution offers:

  • use a single sass-file to customize (no duplicate variables for your project and Ant)
  • hot reload compatibility
  • no dependencies on outdated npm modules
  • easy integration with your existing webpack setup (webpack 3+ tested)
@7u4
7u4 / postgres_queries_and_commands.sql
Created August 27, 2018 16:28 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'