Skip to content

Instantly share code, notes, and snippets.

View Hubbitus's full-sized avatar

Pavel Alexeev aka Pahan-Hubbitus Hubbitus

View GitHub Profile
Добрый вечер. У меня какая-то странная проблема с кодировкой (UTF-8) в storage.get/set.
Простой код:
var t = { en: 'test', ru: 'тест' };
console.log('Object to save', t, JSON.stringify(t));
VK.api(
'storage.set'
,{
key: 'test'
,value: JSON.stringify(t)
Object to save test тест "test тест" main.js:98
Success set: ["test тест"], {"response":1} main.js:108
Success get: ["test ����"], {"response":"\"test ����\""} main.js:116
var template = $.templates({
specialistsTmpl: tmpl
});
$.templates.specialistsTmpl.link(container, {
specialists: list
}, {
onAfterCreate: function(view){
if (view.data instanceof Specialist){
console.log('onAfterCreate', view, view.data, view.tmpl.tmplName, view.data instanceof Specialist);
$(view.nodes()).find('.edit').click(
@Hubbitus
Hubbitus / gist:42a00248e3f0012d6ebf
Last active August 29, 2015 14:15
Modularizing groovy config workaround
// For structured comment of http://naleid.com/blog/2009/07/30/modularizing-groovy-config-files-with-a-dash-of-meta-programming
// SecurityConfigPlain.groovy
security {
includeScript( SecurityDefaults )
active = true
password = 'redefined'
}
// and then use (OtherClass.groovy):
execve("/usr/bin/kcolorchooser", ["kcolorchooser"], [/* 75 vars */]) = 0
brk(NULL) = 0x5619369e1000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ffbf6d20000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=271676, ...}) = 0
mmap(NULL, 271676, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ffbf6cdd000
close(3) = 0
open("/lib64/libKF5XmlGui.so.5", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p5\4\0\0\0\0\0"..., 832) = 832
find -type f -exec sh -c 'F=$( basename "{}" ); mv $F $(echo $F | sed -r "s/^([[:digit:]]+).+?/\1/")' \;
@Hubbitus
Hubbitus / mount.afuse
Created February 11, 2017 15:00
Afuse sshfs automounter (/usr/sbin/mount.afuse)
#!/bin/bash
# afuse-sshfs mount helper to automatically mount remote machines.
# It is intended to be used as mount.afuse in command line. F.e. in /etc/fstab you may mount directory like:
# afuse# /mnt/remote afuse auto 0 0
# And then as regular user just do:
# $ cd /mnt/remote/[email protected]/remote/path
# and folder /mnt/remote/[email protected] will be mounted automatically!
#
# On Mac some also recommend add defer_permissions,noappledouble mount options.