Skip to content

Instantly share code, notes, and snippets.

@dolbyzerr
dolbyzerr / 0dedict.py
Created August 8, 2020 02:59 — forked from josephg/0dedict.py
Apple dictionaries
# Thanks to commenters for providing the base of this much nicer implementation!
# Save and run with $ python 0dedict.py
# You may need to hunt down the dictionary files yourself and change the awful path string below.
# This works for me on MacOS 10.14 Mohave
from struct import unpack
from zlib import decompress
import re
filename = '/System/Library/Assets/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/9f5862030e8f00af171924ebbc23ebfd6e91af78.asset/AssetData/Oxford Dictionary of English.dictionary/Contents/Resources/Body.data'
f = open(filename, 'rb')
@dolbyzerr
dolbyzerr / upload-github-release-asset.sh
Created July 18, 2017 15:46 — forked from stefanbuck/upload-github-release-asset.sh
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
# * repo
cp -R /usr/share/sandbox/templates/configs/* ~/configs/
IP=`cat ~/etc/redis.conf | grep "(?<=bind )[\d.]*" -P --only-matching`
PORT=`cat ~/etc/redis.conf | grep "(?<=port )[\d]*" -P --only-matching`
PASS=`cat ~/.my.cnf | grep "(?<=password=).*$" -P --only-matching`
sed -i "s/_USERNAME_/`whoami`/g" ~/configs/**/*.ini
sed -i "s/_IP_/$IP/g" ~/configs/**/*.ini
sed -i "s/_PORT_/$PORT/g" ~/configs/**/*.ini
sed -i "s/_MYSQLPASSWORD_/`printf "%q" $PASS`/g" ~/configs/**/*.ini
var editor = ace.edit("editor");
var socket = io.connect('http://localhost:3000');
var session = editor.getSession();
session.setMode("ace/mode/markdown");
session.setUseWrapMode(true);
editor.setShowPrintMargin(false);
{
"href": "https://api.megavisor.com/objects/eaa2dd8c-f3f9-4ffd-8bf2-c9cfae50639f",
"name": "Названице",
"description": "Описанице",
"ean": "123",
"type": "photo-360",
"created": 1320296464,
"modified": 1387206110,
"protected": false,
"rating": 1,
var variants = {
"1": ["1","2","4"],
"2": ["2","1","5","3"],
"3": ["3","2","6"],
"4": ["4","1","5","7"],
"5": ["5","2","6","8","4"],
"6": ["6","3","5","9"],
"7": ["7","4","8"],
"8": ["8","5","7","9","0"],
"9": ["9","6","8"],
mjl.require('core');
module 'MV.MP' {
var $class = MV.extend(MV.Observer),
$super = $class.superclass;
MV.implement($class,{
construct : function ( config ) {
@dolbyzerr
dolbyzerr / popup.html
Last active December 22, 2015 03:28
Simple popup implementation
<table class="popup__table">
<tr>
<td>
<div class="popup__inner{{#if width}} span{{width}}{{else}} span9{{/if}}">
<span class="popup__close"><span class="close">&times;</span></span>
<div class="popup__content {{class}}">
{{{content}}}
</div>
</div>
</td>
@dolbyzerr
dolbyzerr / js-embed.md
Last active December 21, 2015 03:08
Вставка объектов Мегавизор, используя javascript API

Для начала нам понадобиться подключить файл, с нашим API

<script type="text/javascript">if(!window.Megavisor){window.document.write('<scr'+'ipt type="text/javascript" src="http://media.megavisor.com/player/api.js"></sc'+'ript>');}</script>

После этого нам станет доступен глобальный объект Megavisor. Megavisor.Player - конструктор плеера. Чтобы создать новый экземпляр плеера следует вызвать его конструктор с параметрами:

var player = new Megavisor.Player({