Skip to content

Instantly share code, notes, and snippets.

View AlexRuiz7's full-sized avatar

Álex Ruiz AlexRuiz7

View GitHub Profile
@PanagiotisPtr
PanagiotisPtr / json_lib.cpp
Last active April 15, 2021 10:52
A very basic JSON Serialiser and Deserialiser in C++
#ifndef JSONLIB_H
#define JSONLIB_H
#include <iostream>
#include <cctype>
#include <unordered_map>
#include <sstream>
#include <memory>
#include <type_traits>
#include <iterator>
@DahlitzFlorian
DahlitzFlorian / Dockerfile
Last active March 31, 2022 10:56
Run Python application as non-root in Docker - requirements.txt
FROM python:3.7.2-alpine
RUN pip install --upgrade pip
RUN adduser -D worker
USER worker
WORKDIR /home/worker
COPY --chown=worker:worker requirements.txt requirements.txt
RUN pip install --user -r requirements.txt
@PanagiotisPtr
PanagiotisPtr / Audio.cpp
Last active March 5, 2024 09:05
WAV File Reader / Writer C++
#pragma once
#include "Audio.h"
Audio::Audio(std::string str) {
if (str.substr(str.size() - 4) != ".wav")
throw std::invalid_argument("Can only read WAV files!");
load_wav(str);
}
@yqritc
yqritc / gist:ccca77dc42f2364777e1
Last active March 29, 2024 10:25
Equal column spacing for Android RecyclerView GridLayoutManager by using custom ItemDecoration

ItemOffsetDecoration

public class ItemOffsetDecoration extends RecyclerView.ItemDecoration {

    private int mItemOffset;

    public ItemOffsetDecoration(int itemOffset) {
        mItemOffset = itemOffset;
    }
@rob-murray
rob-murray / add_intellij_launcer
Last active May 7, 2024 21:18
Add Intellij launcher shortcut and icon for ubuntu
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png
Name[en_US]=IntelliJ