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
/** | |
* Marlin 3D Printer Firmware | |
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] | |
* | |
* Based on Sprinter and grbl. | |
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or |
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
/** | |
* Marlin 3D Printer Firmware | |
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] | |
* | |
* Based on Sprinter and grbl. | |
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or |
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
<?php | |
function getMemoryLimitBytes() | |
{ | |
$limit = ini_get('memory_limit'); | |
if ($limit == -1) return 0; | |
$units = [1 => 'K', 'M', 'G']; | |
$unit = strtoupper(substr($limit, -1)); | |
if ($exp = array_search($unit, $units)) { |
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
// на открытой доске выполнить в консоли | |
(function () { | |
const bid = window.location.pathname.split('/')[2]; | |
const listName = prompt('Enter list name'); | |
const fetchJson = url => new Promise(resolve => setTimeout(resolve, Math.random() * 300)) | |
.then(() => fetch(url)) | |
.then(response => response.json()); | |
const loading = title => { | |
let i = 0; | |
return setInterval(() => console.clear() || console.log(title, ['|', '/', '-', '\\'][(i++ % 4)]), 300); |
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
#!/usr/bin/env bash | |
# Elementary OS specific: | |
# 1) edit file "/etc/lightdm/io.elementary.greeter.conf" | |
# uncomment line 3 "#default-wallpaper=/usr/share/backgrounds/elementaryos-default" | |
# 2) change symbolic link "/usr/share/backgrounds/elementaryos-default" to "~/windows-spotlight-wp/last.jpg" | |
function checkret | |
{ | |
if [ $1 -ne 0 ]; then |
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
for i in {1..1000}; do | |
/opt/cprocsp/bin/amd64/cryptcp -creatcert \ | |
-dn "C=RU,L=Moscow,O=Test inc.,CN=ООО Тест $i,E=test@test.com,INN=$(bash random_inn.sh)" \ | |
-pin '' \ | |
-ca http://testgost2012.cryptopro.ru/certsrv \ | |
-provtype 80 \ | |
-nokeygen \ | |
-cont '\\.\HDIMAGE\testcont100' | |
done |
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
// в открытой карточке выполнить в консоли | |
(function () { | |
const id = window.location.pathname.match(/\/c\/([^/]+)/)?.pop(); | |
const script = document.createElement('script'); | |
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/jsdiff/4.0.1/diff.js'; | |
document.head.appendChild(script); | |
script.onload = function () { | |
fetch(`https://trello.com/1/cards/${id}/actions?filter=updateCard:desc`).then(response => response.json()).then(_history => { | |
console.clear(); |
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
// проверка ИНН | |
function isInnValid(inn){ | |
inn = String(inn).replace(/[^0-9]+/g, '').split(''); | |
if ( inn.length == 10 ) { | |
return inn[9] == String((( | |
2*inn[0] + 4*inn[1] + 10*inn[2] + | |
3*inn[3] + 5*inn[4] + 9*inn[5] + | |
4*inn[6] + 6*inn[7] + 8*inn[8] | |
) % 11) % 10); | |
} |
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
#!/bin/sh | |
DIR="/tmp/fake_sendmail" | |
EXT=".eml" | |
[ ! -d $DIR ] && mkdir $DIR && chmod 0777 $DIR | |
NAME=`date +%s.%N` | |
FILE="$DIR/$NAME$EXT" |
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
<?php | |
/** | |
* Русскоязычный DateTime с дополнениями | |
* | |
* @author Aleksandr <aleksandr@aleksandr.ru> | |
* @link http://www.aleksandr.ru author's website | |
*/ | |
class DateTimeRu extends DateTime | |
{ | |
protected static $FN = array(1=>"Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"); |
NewerOlder