Skip to content

Instantly share code, notes, and snippets.

View guillemcanal's full-sized avatar

Guillem CANAL guillemcanal

View GitHub Profile
@fcharlie
fcharlie / profile.json
Last active December 18, 2022 20:38
My Windows Terminal profile.json
// This file was initially generated by Windows Terminal 0.11.1333.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
// You can add more global application settings here.
@mattparlane
mattparlane / add_containers_to_hosts.rb
Last active January 29, 2018 07:50
Add containers to host's /etc/hosts file
require 'json'
require 'hosts'
loop do
hosts = Hosts::File.read('/etc/hosts')
host_elements = hosts.elements
all_aliases = []
`docker ps`.split(/\n/).each do |line|
cols = line.split(/\s/)
next if cols[0] =~ /[^a-f0-9]/
@croxton
croxton / SSL-certs-OSX.md
Last active March 3, 2024 18:58 — forked from leevigraham/Generate ssl certificates with Subject Alt Names on OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@walm
walm / main.go
Last active May 15, 2024 06:01
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@schmohlio
schmohlio / sse.go
Last active February 13, 2023 08:38 — forked from ismasan/sse.go
Example SSE server in Golang
// v2 of the great example of SSE in go by @ismasan.
// includes fixes:
// * infinite loop ending in panic
// * closing a client twice
// * potentially blocked listen() from closing a connection during multiplex step.
package main
import (
"fmt"
"log"
@serialhex
serialhex / Makefile
Created October 12, 2016 15:00
Makefiles on Windows!!!
#define macros
EXE = executable.exe
SRC = src
BIN = bin
INT = obj
INCL = include
OCV_INC = "$(OPENCV_DIR)\..\..\include"
OCV_LIB = "$(OPENCV_DIR)\lib\opencv_world310.lib"
@jewel-andraia
jewel-andraia / to-clipboard.ps1
Created April 14, 2016 00:24
Copy image to clipboard using PowerShell
[Reflection.Assembly]::LoadWithPartialName('System.Drawing');
[Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms');
$filename = 'C:\Users\Administrator\Pictures\background-logo-1024.png';
$file = get-item($filename);
$img = [System.Drawing.Image]::Fromfile($file);
[System.Windows.Forms.Clipboard]::SetImage($img);
@kuntau
kuntau / yify.md
Last active May 23, 2024 19:00
YIFY's Quality Encoding

For those that want to keep the YTS going (No, IDGAF about people that don't care for YTS quality) get HandbrakeCLI https://handbrake.fr/downloads... and use the following settings:

user@user:~$HandBrakeCLI -i /file/input.mp4 -o /file/out.mp4 -E fdk_faac -B 96k -6 stereo -R 44.1 -e x264 -q 27 -x cabac=1:ref=5:analyse=0x133:me=umh:subme=9:chroma-me=1:deadzone-inter=21:deadzone-intra=11:b-adapt=2:rc-lookahead=60:vbv-maxrate=10000:vbv-bufsize=10000:qpmax=69:bframes=5:b-adapt=2:direct=auto:crf-max=51:weightp=2:merange=24:chroma-qp-offset=-1:sync-lookahead=2:psy-rd=1.00,0.15:trellis=2:min-keyint=23:partitions=all

Reason to use CLI over GTK has to do with lack of support for advanced settings for Handbrake GTK

** Don't Re-encode already shitty encodes...get good source!**

@theothermattm
theothermattm / sync-using-gitignore.sh
Created October 7, 2015 20:58
Rsync files using .gitignore
# sync everything excluding things in .gitignore
# delete anything on target not in source
# include dotfiles and symlinks, also use compression
rsync -azP --delete --filter=":- .gitignore" . my-target-host:/my/target/directory
@kbond
kbond / AppKernel.php
Last active March 6, 2020 19:10
JWT Authentication With Symfony Guard. POST username/password to /login to receive token, /api* requests require a valid token
<?php
// app/AppKernel.php
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;
class AppKernel extends Kernel
{
public function registerBundles()
{