Skip to content

Instantly share code, notes, and snippets.

View nuty's full-sized avatar

Rosso nuty

  • beijing
View GitHub Profile
@islishude
islishude / k8s-install.md
Last active August 21, 2025 08:24
k8s-国内源安装

MOVE TO HERE

注意以下命令,需要切换到 root 后运行

安装 docker

首先确定已经安装完成 docker,如果没有安装可以使用以下脚本快速安装并配置:

@DarrenN
DarrenN / net-lens.rkt
Created January 21, 2018 20:25
Fun with Lenses, structs and net/url in Racket
#lang racket/base
(require json
lens
net/url
net/url-string
net/head
racket/dict
racket/string)
@ibraheem4
ibraheem4 / postgres-brew.md
Last active September 27, 2025 02:49 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
#lang racket
(require http) ;; not installed by default
;; do raco pkg install http
(define (http-request uri
#:redirects [redirects 10]
#:http-version [http-version "1.1"]
#:method [method "GET"]
#:data [data #""]
  • What do Etcd, Consul, and Zookeeper do?
    • Service Registration:
      • Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
    • Service Discovery:
      • Ability for client application to query the central registry to learn of service location.
    • Consistent and durable general-purpose K/V store across distributed system.
      • Some solutions support this better than others.
      • Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
  • Centralized locking can be based on this K/V store.
@tomconte
tomconte / web3-solc-contract-compile-deploy.js
Created December 13, 2016 09:32
Compiling and deploying an Ethereum Smart Contract, using solc and web3.
const fs = require('fs');
const solc = require('solc');
const Web3 = require('web3');
// Connect to local Ethereum node
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
// Compile the source code
const input = fs.readFileSync('Token.sol');
const output = solc.compile(input.toString(), 1);
@miminus
miminus / pyenv.md
Created July 20, 2016 09:49
为Mac 设置Python多版本开发环境

##参考链接

##问题 - 可能会遇到多个版本同时部署的情况

  • 系统自带的Python是2.x,自己需要Python 3.x,测试尝鲜;
  • 系统是2.6.x,开发环境是2.7.x
  • 由于Mac机器系统保护的原因,默认的Python中无法对PIP一些包升级,需要组建新的Python环境
  • 此时需要在系统中安装多个Python,但又不能影响系统自带的Python,即需要实现Python的多版本共存。pyenv就是这样一个Python版本管理器

##解决方法 - pyenv

@max-kov
max-kov / matrix.py
Last active July 2, 2022 02:13
matrix falling code in python using pygame
import pygame, pygame.font
import random
def IsWritten():
defTemp = True
for x in xrange((lettersOnScreen[0] / 2) - (len(str) / 2), (lettersOnScreen[0] / 2) + (len(str) / 2) + 1):
if xHeads[x] == -1:
defTemp = False
return defTemp
@jamtur01
jamtur01 / riemann.config
Last active September 10, 2016 16:08
Example of Riemann index lookup a la Nagios Herald
(require 'riemann.common)
(require 'clojure.pprint)
(let [host "0.0.0.0"]
(graphite-server :host host
:port 5559)
(tcp-server :host host)
(udp-server :host host
:max-size 65000)
(repl-server :host host)
@gaearon
gaearon / AudioPlayer.jsx
Created October 31, 2014 22:13
React <audio> wrapper
/** @jsx React.DOM */
'use strict';
var React = require('react'),
{ PropTypes } = React;
var AudioPlayer = React.createClass({
propTypes: {
source: PropTypes.string.isRequired,
isPlaying: PropTypes.bool.isRequired,