Skip to content

Instantly share code, notes, and snippets.

View kevingo's full-sized avatar
🏠
Working from home

kevingo kevingo

🏠
Working from home
View GitHub Profile
@paulmillr
paulmillr / active.md
Last active June 24, 2024 13:58
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 1000)
#!/bin/bash
#
# #############################################################################
# Create new SSH user (Ubuntu)
# I use this script whenever I need to add a new SSH user to an Ubuntu machine.
# Usage:
# 1) Download the "raw" with - wget -O createNewSSHUser.sh https://gist.github.com/raw/4223476
# 2) Make it executable with - chmod a+x createNewSSHUser.sh
# 3) Uncomment the last line and edit the user & pwd values
# 4) Execute it with : sudo ./createNewSSHUser.sh
package main
import (
"fmt"
"github.com/moovweb/gokogiri"
"io/ioutil"
"net/http"
"net/url"
"time"
)
@hanksudo
hanksudo / Front-end-Developer-Interview-Questions-TC.md
Last active May 2, 2024 06:26
Front-end-Developer-Interview-Questions - 前端工程師面試問題集(繁體中文版)

前端工程師面試問題集

@版本 2.0.0

譯注:此翻譯版,主要給不能流利的讀英文的人看,相關專有名詞還是保留原文。翻譯不好地方請協助pull request.

此repository包含了一些前端開發的面試問題,來審查一個有潛力的面試者。這並不是建議你對同一個面試者問上所有的問 (那會花費好幾小時)。從列表中挑幾個題目,應該就夠幫助你審查面試者是否擁有你需要的技能。

Rebecca MurpheyBaseline For Front-End Developers 也是一篇很棒且值得讀的文章在你開始面試之前。

@haldun
haldun / nba-teams.txt
Created July 2, 2013 08:30
NBA team list in plain text
Atlanta Hawks
Boston Celtics
Brooklyn Nets
Charlotte Bobcats
Chicago Bulls
Cleveland Cavaliers
Dallas Mavericks
Denver Nuggets
Detroit Pistons
Golden State Warriors

Using pg.connect is the way to go in a web environment.

PostgreSQL server can only handle 1 query at a time per conenction. That means if you have 1 global new pg.Client() connected to your backend your entire app is bottleknecked based on how fast postgres can respond to queries. It literally will line everything up, queuing each query. Yeah, it's async and so that's alright...but wouldn't you rather multiply your throughput by 10x? Use pg.connect set the pg.defaults.poolSize to something sane (we do 25-100, not sure the right number yet).

new pg.Client is for when you know what you're doing. When you need a single long lived client for some reason or need to very carefully control the life-cycle. A good example of this is when using LISTEN/NOTIFY. The listening client needs to be around and connected and not shared so it can properly handle NOTIFY messages. Other example would be when opening up a 1-off client to kill some hung stuff or in command line scripts.

@sloria
sloria / bobp-python.md
Last active July 7, 2024 18:13
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@t-io
t-io / osx_install.sh
Last active October 22, 2023 13:04
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@caged
caged / syncteams.sh
Created February 9, 2014 08:46
Sync NBA team data from stats.nba.com
#!/bin/sh
for year in $(seq 1996 2013); do
shortyear=$((year+1))
season="${year}-${shortyear:2:2}"
echo "Fetching ${season}..."
for stat_type in Base Advanced Misc 'Four+Factors' Scoring Opponent; do
url="http://stats.nba.com/stats/leaguedashteamstats?Season=${season}&SeasonType=Regular+Season&LeagueID=00&MeasureType=${stat_type}&PerMode=Totals&PlusMinus=N&PaceAdjust=N&Rank=N&Outcome=&Location=&Month=0&SeasonSegment=&DateFrom=&DateTo=&OpponentTeamID=0&VsConference=&VsDivision=&GameSegment=&Period=0&LastNGames=0&GameScope=&PlayerExperience=&PlayerPosition=&StarterBench=&sortField=PTS&sortOrder=DES&pageNo=1&rowsPerPage=30"
@akesterson
akesterson / gist:11391984
Created April 29, 2014 06:22
Why I switched from bamboo to jenkins
TL;DR - It was proving to be more buildsystem than I needed,
and I had found that there were other buildsystems that met my needs
that I felt were lighter and more nimble. It's still a fine product
that I continue to recommend to this day, I just no longer see it as
"The One True Way".
=========================
1: Bamboo was consuming a significant amount of system resources,