Skip to content

Instantly share code, notes, and snippets.

View vigo's full-sized avatar
📺
Everything that has a beginning has an end.

Uğur Özyılmazel vigo

📺
Everything that has a beginning has an end.
View GitHub Profile
@gagoit
gagoit / simple-bash-and-github-action-for-creating-the-release-from-a-tag.md
Created October 28, 2020 09:22
Simple bash + Github Action for creating the release

Github action for creating the release from a tag

Create file .github/workflows/create-release-from-a-tag.yml with the content:

on:
  push:
    # Sequence of patterns matched against refs/tags
    tags:
      - 'release*' # Push events to matching release*, i.e. release-1.0, release-20.15.10, release-2020-10-28-10-26-15

name: Create Release
@tekin
tekin / .gitattributes
Last active December 2, 2024 14:23
An example .gitattributes file that will configure custom hunk header patterns for some common languages and file formats. See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details.
# Stick this in your home directory and point your Global Git config at it by running:
#
# $ git config --global core.attributesfile ~/.gitattributes
#
# See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details
*.c diff=cpp
*.h diff=cpp
*.c++ diff=cpp
*.h++ diff=cpp
@MelchiSalins
MelchiSalins / http-rate-limit.go
Last active February 17, 2025 19:24
GoLang HTTP Client with Rate Limiting
package main
import (
"context"
"fmt"
"net/http"
"time"
"golang.org/x/time/rate"
)
@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@jefftriplett
jefftriplett / python-django-postgres-ci.yml
Last active March 27, 2024 04:27
This is a good starting point for getting Python, Django, Postgres running as a service, pytest, black, and pip caching rolling with GitHub Actions.
name: CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
services:
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 8, 2025 14:18
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@apptects
apptects / receiptvalidator.go
Last active December 13, 2022 16:10
Receipt validation on server side
package main
import (
"bytes"
"encoding/json"
"fmt"
"github.com/gorilla/mux"
"log"
"net/http"
)
@keidrun
keidrun / README.md
Last active May 20, 2024 13:42
How to marshal and unmarshal sql.Null types to JSON in golang

Answer

Use custom nullable types instead of original sql.Null types like sql.NullBool, sql.NullFloat64, sql.NullInt64 or sql.NullString.

@sarthology
sarthology / regexCheatsheet.js
Created January 10, 2019 07:54
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@hakib
hakib / admin.py
Last active January 22, 2024 15:18
How to Turn Django Admin Into a Lightweight Dashboard
# https://hakibenita.com/how-to-turn-django-admin-into-a-lightweight-dashboard
from django.contrib import admin
from django.db.models import Count, Sum, Min, Max, DateTimeField
from django.db.models.functions import Trunc
from . import models
def get_next_in_date_hierarchy(request, date_hierarchy):