Skip to content

Instantly share code, notes, and snippets.

View jfernandz's full-sized avatar
🎯
Focusing

Javier Fernández jfernandz

🎯
Focusing
View GitHub Profile
@solace
solace / migration.py
Created November 6, 2020 14:00
Django: Add Permissions to Groups during Migration
# YMMV
from django.conf import settings
from django.contrib.auth.models import Group, Permission
from django.core.management.sql import emit_post_migrate_signal
from django.db import migrations, models
import django.db.models.deletion
import logging
@cfstras
cfstras / status.html
Last active February 6, 2023 03:24
Simple Minecraft Server status box using http://api.syfaro.net/
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<script>
var rq = '//api.syfaro.net/server/status';
var error = 'unknown';
var classes = {
error: "fa-question",
false: "fa-times",
true: "fa-check",
};
@johanmeiring
johanmeiring / gist:3002458
Created June 27, 2012 08:32
"git lg" alias for pretty git log
# From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
@tmhedberg
tmhedberg / largepkg
Created June 16, 2011 16:34
List installed Arch Linux packages in descending order of size
#!/bin/bash
for pkg in `pacman -Qq`; do
size=`
pacman -Qi $pkg |
grep '^Installed Size' |
awk -F '[[:space:]]+:[[:space:]]+' '{print $2}'
`
echo "$size - $pkg"
done |