Skip to content

Instantly share code, notes, and snippets.

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
process {
resource_limits {
time_limit_millis: 1000
memory_limit_bytes: 1073741824
}
file {
id: "stdin"
permission: READ
init: "in"
}
@sarum9in
sarum9in / Makefile
Last active June 3, 2016 21:58 — forked from duskborn/nya.c
LDFLAGS = -lcursesw
nya: nya.c
@sarum9in
sarum9in / gcc-1.patch
Created May 22, 2016 01:28
protobuf3 gcc patches
--- a/src/google/protobuf/util/internal/protostream_objectsource_test.cc 2016-05-16 22:34:04.000000000 +0400
+++ b/src/google/protobuf/util/internal/protostream_objectsource_test.cc 2016-05-22 05:16:56.210068181 +0400
@@ -132,6 +132,7 @@
->RenderUint32("", bit_cast<uint32>(0))
->RenderUint32("", bit_cast<uint32>(3202))
->EndList()
+ ;(&ow_)
->StartList("repU32")
->RenderUint32("", bit_cast<uint32>(3203))
->RenderUint32("", bit_cast<uint32>(0))
"yandex::contest::invoker::detail::execution::async_process_group_detail::Task": {
"processes": [
{
"meta": {
"id": "0",
"name": ""
},
"descriptors": {
"0": {
"File": {
#!/bin/bash -e
regex='^(\[.*\]) (\[.*\]) ([^ ]+) ([^ ]+) \((.*) -> (.*)\)$'
prepare()
{
while read str
do
date=$(echo $str | sed -r "s|$regex|\1|")
db=$(echo $str | sed -r "s|$regex|\2|")
#!/usr/bin/python3
from pprint import pprint
a = 'абвгдеёжзийклмнопрстуфхцчшщъыьэюя'
p = '?????о???????????????????????????'
#p = '????????д??????о??п??????????????'
#p = 'с??????????????т?о???????????????'
#!/usr/bin/python3
a = 'абвгдеёжзийклмнопрстуфхцчшщъыьэюя'
s = 'бяэ иыюшт плйэ олявпозлал ъкуёзилмвбёфвозлал оиляэнь ялищхлал'
for shift in range(len(a)):
for c in s:
if c in a:
x = a.index(c)
y = (x + shift) % len(a)
@sarum9in
sarum9in / test.sh
Created November 7, 2014 11:35
pipefail example
#!/bin/sh
file="I/Don't/Exist"
cat "$file" | true
echo $?
set -o pipefail
cat "$file" | true
#!/bin/bash -e
exec 2>&1
archive="${1:?you have to specify archive}"
on_exit()
{
if [[ $tmp ]]
then