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
version: "3.2" | |
services: | |
znc: | |
image: linuxserver/znc | |
container_name: znc | |
environment: | |
- PUID=1000 | |
- PGID=1000 | |
- TZ=America/Sao_Paulo | |
volumes: |
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 <QApplication> | |
#include "window.h" | |
int main(int argc, char **argv) | |
{ | |
QApplication app(argc, argv); | |
Window window; | |
window.show(); |
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 zipfile | |
import os | |
from typing import List | |
def extract(file: str, path: str=".") -> List[str]: | |
names = [] | |
with zipfile.ZipFile(file) as zip_file: | |
for member in zip_file.namelist(): | |
data = zip_file.read(member) |
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 | |
# do-the-webp.sh | |
# Author: Pedro Vanzella <pedro@pedrovanzella.com> | |
# Usage: do-the-webp.sh <dir> | |
# License: BSD | |
# | |
# Finds all cbz and cbr files in a directory and converts all files inside to | |
# webp with quality 80, which should yield a 30% compression with no noticeably | |
# loss of quality |
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
class ApplicationController < ActionController::Base | |
#SNIP | |
rescue_from ActionController::UnpermittedParameters do |error| | |
if Rails.env.development? || Rails.env.test? | |
raise # Raise again and fail lowdly in dev and test | |
else | |
SLACK_NOTIFIER.ping("[#{Rails.env}] UNPERMITTED PARAMETERS! #{error}\nBacktrace:\n#{error.backtrace}") | |
end | |
end |
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
class Memory { | |
public: | |
Memory(std::array<uint8_t, 1024> b) { buff_ = std::move(b); } | |
uint16_t& operator[](uint16_t addr) { | |
return (buff_[addr] << 8) + buff_[addr + 1]; // This doesn't work | |
// cannot bind non-const lvalue reference of type ‘uint16_t& {aka short unsigned int&}’ to an rvalue of type ‘uint16_t {aka short unsigned int}’ | |
} | |
private: |
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
class ROM { | |
public: | |
ROM(std::array<uint8_t, 1024> buf) { _buffer = std::move(buf); } | |
const uint16_t operator[](const uint16_t offset) const { | |
if (offset > _buffer.size()) { | |
return 0x0; | |
} | |
// This is a big-endian machine, indexed by 16-bit words | |
return (_buffer[offset] << 8) + (_buffer[offset + 1]); | |
} |
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 python | |
import numpy | |
from mpi4py import MPI | |
NUMARRAYS = 100 | |
ARRAYSIZE = 10000 | |
ASK_FOR_WORK_TAG = 1 | |
WORK_TAG = 2 | |
WORK_DONE_TAG = 3 |
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 | |
ffmpeg -i “$1″ -acodec alac “`basename “$1″ .flac`.m4a” \ | |
-metadata title=\”"$(metaflac –show-tag=TITLE “$1″ | sed ‘s/title=//g’)”\” \ | |
-metadata author=\”"$(metaflac –show-tag=ARTIST “$1″ | sed ‘s/artist=//g’)”\” \ | |
-metadata album=\”"$(metaflac –show-tag=ALBUM “$1″ | sed ‘s/album=//g’)”\” \ | |
-metadata year=\”"$(metaflac –show-tag=DATE “$1″ | sed ‘s/date=//g’)”\” \ | |
-metadata track=\”"$(metaflac –show-tag=TRACKNUMBER “$1″ | sed ‘s/tracknumber=//g’)”\” \ | |
-metadata genre=\”"$(metaflac –show-tag=GENRE “$1″ | sed ‘s/genre=//g’)”\” |
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
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
NewerOlder