Skip to content

Instantly share code, notes, and snippets.

View vmpartner's full-sized avatar

Musin Vitaly vmpartner

  • Russia
View GitHub Profile
@vmpartner
vmpartner / gist:dcc271f70f452b79760c4b647c588091
Last active April 26, 2018 13:15
golang iterate struct keys
v := reflect.ValueOf(client)
for i := 0; i < v.NumField(); i++ {
key := v.Type().Field(i).Name
value := ""
switch v.Field(i).Type().String() {
case "int64":
value = strconv.Itoa(int(v.Field(i).Int()))
@vmpartner
vmpartner / convert.sh
Last active August 29, 2015 14:18 — forked from akost/convert.sh
#!/bin/bash
# Recursive file convertion utf-8 --> windows-1251
# Place this file in the root of your site, add execute permission and run
# Converts *.php, *.html, *.css, *.js files.
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command
find ./ -name "*.php" -o -name "*.html" -o -name "*.css" -o -name "*.js" -type f |
while read file
do