Skip to content

Instantly share code, notes, and snippets.

View koooge's full-sized avatar
🍘
This is Senbei.

koooge koooge

🍘
This is Senbei.
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active June 29, 2024 11:18
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@linyows
linyows / postgresql.md
Created June 19, 2018 06:06
インフラエンジニアがいざという時に抑えておきたい postgresql コマンド

一旦テーブルの中身を把握したい時に使える一括CSV形式での出力

psql DATABASE_URL -c "select id,title from articles" -A -F,  | pbcopy 
  • -A 位置揃えなし
  • -F, カンマ区切り
  • DATABASE_URLpostgres://user:password@host:port/database
@RemeJuan
RemeJuan / action.js
Created May 21, 2018 13:30
Race Conditions Redux
export const SEARCH_POST_START = 'SEARCH_POST_START';
export const searchPostNoResults = data => ({
type: SEARCH_POST_NO_RESULTS, data,
});
@CarolusX74
CarolusX74 / AuthTokenRefreshInterceptor.java
Last active March 15, 2022 04:42
How I automatically refresh OAuth "access token" with okhttp interceptors using "refresh token". All requests will wait until token refresh finished, and then will continue with the new token. - EN (By Carlos Torres)
package com.cjtp.android.api.interceptors;
import android.util.Log;
import com.google.gson.JsonObject;
import com.inviteez.android.core.Session;
import com.inviteez.android.utils.Constant;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
@mono0926
mono0926 / commit_message_example.md
Last active June 24, 2024 02:44
[転載] gitにおけるコミットログ/メッセージ例文集100
@alex-shpak
alex-shpak / Interceptor.java
Last active June 14, 2024 02:40
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
private class HttpInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
//Build new request
Request.Builder builder = request.newBuilder();
builder.header("Accept", "application/json"); //if necessary, say to consume JSON
@sheikhwaqas
sheikhwaqas / setup-mysql.sh
Last active September 6, 2023 15:59
Install MySQL Server on Ubuntu (Non-Interactive Installation)
# Download and Install the Latest Updates for the OS
apt-get update && apt-get upgrade -y
# Set the Server Timezone to CST
echo "America/Chicago" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# Enable Ubuntu Firewall and allow SSH & MySQL Ports
ufw enable
ufw allow 22
@rxaviers
rxaviers / gist:7360908
Last active June 29, 2024 18:36
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: