Skip to content

Instantly share code, notes, and snippets.

View thanhtungka91's full-sized avatar
🎯
Focusing

Vo Thanh Tung thanhtungka91

🎯
Focusing
View GitHub Profile
@felipekm
felipekm / LC_TYPE.txt
Last active November 30, 2020 02:36
Linux warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory manpath: can't set the locale; make sure $LC_* and $LANG are correct
vi /etc/environment
# add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@alexedwards
alexedwards / main_test.go
Last active June 15, 2024 00:55
MaxOpenConns benchmark
package main
import (
"database/sql"
"testing"
"time"
_ "github.com/lib/pq"
)
@thanhtungka91
thanhtungka91 / salesforce.php
Last active January 8, 2019 07:19
for example login salesforce
<?php
require_once("../require.php");
class SC_Helper_SaleForce
{
// login and return access_token, url
public function login()
{
// create class Log for dev, only in dev enviroment
// $this->log_dev = new Log_Dev_Salesforce();
// $this->log_dev->logging_debug("","login","");
@addyosmani
addyosmani / workbox.md
Last active January 20, 2024 16:14
Workbox recipes

Workbox runtime caching recipes

Your Service Worker script will need to import in Workbox and initialize it before calling any of the routes documented in this write-up, similar to the below:

importScripts('workbox-sw.prod.v1.3.0.js');
const workbox = new WorkboxSW();

// Placeholder array populated automatically by workboxBuild.injectManifest()
@F21
F21 / gist:08bfc2e3592bed1e931ec40b8d2ab6f5
Last active October 23, 2022 12:36
Minikube RBAC Quick Start
minikube start --kubernetes-version=v1.7.0 --extra-config=apiserver.Authorization.Mode=RBAC
kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
minikube dashboard
@so0k
so0k / kubectl.md
Last active February 4, 2025 17:16
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@dtjm
dtjm / join_test.go
Last active May 20, 2025 06:16
Benchmarking various ways of concatenating strings in Go
package join
import (
"fmt"
"strings"
"testing"
)
var (
testData = []string{"a", "b", "c", "d", "e"}
@jasonrudolph
jasonrudolph / gist:6057563
Last active February 20, 2025 11:03
GitHub Search API: Get the number of stars for a repository

James Sugrue [asked][1], "@GitHubAPI is there a way to find the number of stars for a given repository?"

Example

$ curl -ni "https://api.github.com/search/repositories?q=more+useful+keyboard" -H 'Accept: application/vnd.github.preview'
{
class Node(object):
"""
Tree node: left and right child + data which can be any object
"""
def __init__(self, data):
"""
Node Constructor
@param data node data object
"""
self.left = None
@nateware
nateware / nginx.conf
Last active November 23, 2021 10:54
Nginx sample config for EC2
#
# Sample nginx.conf optimized for EC2 c1.medium to xlarge instances.
# Also look at the haproxy.conf file for how the backend is balanced.
#
user "nginx" "nginx";
worker_processes 10;
error_log /var/log/nginx_error.log info;