This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2007. Adobe Systems, Incorporated. All rights reserved. | |
// This script will export each layer in the document to a separate file. | |
// Written by Naoki Hada | |
// ZStrings and auto layout by Tom Ruark | |
// Bug fixes by Eric Ching | |
/* | |
@@@BUILDINFO@@@ Export Layers To Files.jsx 1.0.0.22 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
def sha256sum(filename): | |
with open(filename, 'rb', buffering=0) as f: | |
return hashlib.file_digest(f, 'sha256').hexdigest() | |
print(sha256sum('foo.bar')) | |
# sample output: | |
# E95ECA399DFE95500C4DE569EFC4CC77B75E2B66A864D467DF37733EC06A0FF2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open(file_name, mode='r+b') as f: | |
f.seek(-200, 2) # seek from the end | |
d = f.read(200) # read from current pos | |
f.seek(0) # seek to begin | |
f.write(d) # write to current pos | |
f.seek(-200, 2) # seek from the end | |
f.truncate() # truncate at current pos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires AutoHotkey v2.0 | |
; Возможно окошко автосохранения в Премьере будет сбивать скрипт с понтологии | |
; Возможно стоит открыть один раз окно экспорта (Ctrl+Space), т.к. первый раз открывается долго, а скрипт ждет фиксированное время | |
; Текст в заголовке окна, по которому находим Премьер | |
windowsTitle := "Adobe Premiere Pro CC 2017" | |
; Текст в заголовке окна, по которому находим Энкодер | |
windowsTitleEncoder := "Adobe Media Encoder CC 2017" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: monospace; | |
font-size: 12pt; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Simple listener.c program for UDP multicast | |
// | |
// Adapted from: | |
// http://ntrg.cs.tcd.ie/undergrad/4ba2/multicast/antony/example.html | |
// | |
// Changes: | |
// * Compiles for Windows as well as Linux | |
// * Takes the port and group on the command line | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from wcmatch import pathlib | |
def glob_files(base_dir, glob_list): | |
file_list = set() | |
for file_glob in glob_list: | |
if file_glob.startswith('!'): | |
p = base_dir.as_posix() + '/' + file_glob[1:] | |
file_list = {i for i in file_list if not i.match(p, flags=pathlib.GLOBSTAR + pathlib.BRACE)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "MurmurHash3.h" | |
#include "doctest.h" | |
#include <string> | |
#include <vector> | |
static void TestString(const std::string& s, uint32_t seed, uint32_t expected) | |
{ | |
uint32_t hash; | |
MurmurHash3_x86_32(s.c_str(), s.length(), seed, &hash); | |
CHECK(hash == expected); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void test3() | |
{ | |
int ret; | |
const uint8_t key[16] = { 0xfe, 0x03, 0xcc, 0x7e, 0x7a, 0x59, 0x4a, 0x82, 0x6c, 0x3e, 0x1d, 0xec, 0x26, 0x5d, 0xdd, 0xcf }; | |
const uint8_t iv[16] = { 0x3a, 0x1d, 0x70, 0x5c, 0xb0, 0xed, 0xa3, 0xad, 0xdd, 0xe8, 0x3d, 0x4b, 0x48, 0xeb, 0x26, 0xe2 }; | |
const size_t iv_len = 12; // в тестах есть значения 12, 12, 12, 12, 8, 60 | |
const uint8_t add_data[3] = { 42, 43, 44 }; | |
const size_t add_data_len = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <chrono> | |
using namespace std::chrono; | |
int main() { | |
auto from = sys_days{March/16/2020}; | |
auto to = sys_days{August/7/2020}; | |
std::cout << (to - from).count() << std::endl; |
NewerOlder