Skip to content

Instantly share code, notes, and snippets.

View TheSirC's full-sized avatar
💭
Chopping some HEADs down

le Duc Banal TheSirC

💭
Chopping some HEADs down
View GitHub Profile
@TheSirC
TheSirC / shell.nix
Last active September 20, 2023 01:29
egui/eframe with NixOS
{ pkgs ? import <nixpkgs> { overlays = [ (import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz)) ]; } }:
with pkgs;
mkShell {
nativeBuildInputs = with xorg; [
libxcb
libXcursor
libXrandr
libXi
@TheSirC
TheSirC / v4l2.nix
Last active March 27, 2023 19:30
My Nix module to work with v4l2loopback
{ lib, config, pkgs, ... }:
with lib;
{
options.v4l2 = mkEnableOption "Enable the confguration to use the reflex as a webcam";
config = mkIf config.v4l2 {
# 20.03: v4l2loopback 0.12.5 is required for kernel >= 5.5
# https://github.com/umlaeute/v4l2loopback/issues/257
@TheSirC
TheSirC / default.nix
Last active May 1, 2022 11:05
Packaging attempt for sftpgo
# Build with `nix-build -E "with import <nixpkgs> {}; callPackage ./sftpgo.nix {}"`
{ buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "sftpgo";
version = "2.2.2";
src = fetchFromGitHub {
owner = "drakkan";
repo = "sftpgo";
rev = "v${version}";
@TheSirC
TheSirC / _linear-interpolation.scss
Created March 21, 2021 14:29 — forked from Jakobud/_linear-interpolation.scss
Linear Interpolation SASS function
/// linear-interpolation
/// Calculate the definition of a line between two points
/// @param $map - A SASS map of viewport widths and size value pairs
/// @returns A linear equation as a calc() function
/// @example
/// font-size: linear-interpolation((320px: 18px, 768px: 26px));
/// @author Jake Wilson <jake.e.wilson@gmail.com>
@function linear-interpolation($map) {
$keys: map-keys($map);
@if (length($keys) != 2) {
@TheSirC
TheSirC / _poly-fluid-sizing.scss
Created March 20, 2021 23:23 — forked from Jakobud/_poly-fluid-sizing.scss
Poly Fluid Sizing using linear equations, viewport units and calc()
/// poly-fluid-sizing
/// Generate linear interpolated size values through multiple break points
/// @param $property - A string CSS property name
/// @param $map - A SASS map of viewport unit and size value pairs
/// @requires function linear-interpolation
/// @requires function map-sort
/// @example
/// @include poly-fluid-sizing('font-size', (576px: 22px, 768px: 24px, 992px: 34px));
/// @author Jake Wilson <jake.e.wilson@gmail.com>
@mixin poly-fluid-sizing($property, $map) {
@TheSirC
TheSirC / main.m
Created April 9, 2018 14:02
Projet Cristal Photonique
%The program for the computation of the PhC photonic
%band structure for 2D PhC.
%Parameters of the structure are defined by the PhC
%period, elements radius, and by the permittivities
%of elements and background material.
%Input parameters: PhC period, radius of an
%element, permittivities
%Output data: The band structure of the 2D PhC.
clear all; close all; clf;
%The variable a defines the period of the structure.
@TheSirC
TheSirC / 30-randomize-mac-address.conf
Created December 3, 2017 20:16 — forked from fawkesley/30-randomize-mac-address.conf
MAC address randomization in Ubuntu 17+ (>= 1.4.1): save to /etc/NetworkManager/conf.d/
# /etc/NetworkManager/conf.d/30-randomize-mac-address.conf
# REQUIRES NETWORK MANAGER >= 1.4.1 (Ubuntu Zesty and above)
# Thanks to https://blogs.gnome.org/thaller/2016/08/26/mac-address-spoofing-in-networkmanager-1-4-0/
# This randomize your MAC address for *new* connections
# Be sure to change your existing (saved) connections in
# /etc/NetworkManager/system-connections/*
@TheSirC
TheSirC / sheet.tex
Created November 29, 2017 17:41 — forked from jamiees2/sheet.tex
A template for LaTeX cheat sheets
% \documentclass[9pt,a4paper,twocolumn,landscape,oneside]{amsart}
\documentclass[9pt,a4paper,landscape,oneside]{amsart}
\usepackage{amsmath, amsthm, amssymb, amsfonts}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{fullpage}
%\usepackage{geometry}
@TheSirC
TheSirC / MakeOpenVPN.sh
Created October 13, 2017 11:43 — forked from maxauvy/MakeOpenVPN.sh
MakeOpenVPN.sh
#!/bin/bash
# Déclaration des variables par défaut
DEFAULT="Default.txt"
FILEEXT=".ovpn"
CRT=".crt"
KEY=".3des.key"
CA="ca.crt"
TA="ta.key"
@TheSirC
TheSirC / boot.config
Created September 8, 2016 17:42 — forked from kgersen/boot.config
orange ERL 3 - remplacement complet de la Livebox routeur
firewall {
all-ping enable
broadcast-ping disable
ipv6-receive-redirects disable
ipv6-src-route disable
ip-src-route disable
log-martians enable
name WAN_IN {
default-action drop
description "Packets from Internet to LAN"