Skip to content

Instantly share code, notes, and snippets.

View C0nstantin's full-sized avatar

Constantin Karataev C0nstantin

View GitHub Profile
@C0nstantin
C0nstantin / configmap.yaml
Created January 28, 2022 15:08 — forked from jferris/configmap.yaml
Rails Kubernetes Manifests
apiVersion: v1
kind: ConfigMap
metadata:
name: example
namespace: default
data:
APPLICATION_HOST: example.com
LANG: en_US.UTF-8
PIDFILE: /tmp/server.pid
PORT: "3000"
# debian
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main
deb http://http.debian.net/debian/ wheezy main contrib non-free
# yandex
deb http://mirror.yandex.ru/debian/ wheezy main contrib non-free
deb-src http://mirror.yandex.ru/debian/ wheezy main contrib non-free
deb http://mirror.yandex.ru/debian/ wheezy-updates main non-free
deb-src http://mirror.yandex.ru/debian/ wheezy-updates main non-free
@C0nstantin
C0nstantin / gist:fb5828fb970027e43297
Created May 27, 2015 12:53
utf8 to cp1251 and cp1251 to utf8
import(
"github.com/qiniu/iconv"
)
utf2cp,err :=iconv.Open("cp1251","utf8"); //convert utf8 to cp1251
if err!=nil {
return err,""
}
defer utf2cp.Close();
import(
"code.google.com/p/go.text/transform"
"code.google.com/p/go.text/encoding/charmap"
)
func toutf8(str string) string {
sr := strings.NewReader(str)
tr := transform.NewReader(sr, charmap.Windows1251.NewDecoder())
buf, err := ioutil.ReadAll(tr)
if err != nil {
@C0nstantin
C0nstantin / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/bin/bash
# install homebrew's official php tap
brew tap josegonzalez/homebrew-php
# install homebrew-dupes (required to install zlib, php54's dependency)
brew tap homebrew/dupes
# install nginx + mysql + php 5.4 + php-fpm + apc + xdebug
brew install nginx mysql