Skip to content

Instantly share code, notes, and snippets.

View GoOz's full-sized avatar
🤔
Building stuff… for a change

GoOz GoOz

🤔
Building stuff… for a change
View GitHub Profile
@GoOz
GoOz / .js
Created October 30, 2025 08:49
null
data.forEach((line) => {
if (line.quota === null) {
line.quota = "—"
} else if (line.quota) {
line.quota = formatBytes(line.quota, locale)
}
})
@GoOz
GoOz / frame.sh
Created January 16, 2025 22:31
frame.sh
query=./img.jpg
width=$(identify -format '%w' $query)
height=$(identify -format '%h' $query)
ratioLongest=1.2147
ratioShortest=1.472
if ["$width" -gt "$height"]
then
newWidth=$(echo "$width * $ratioLongest;" | bc)
newHeight=$(echo "$height * $ratioShortest;" | bc)
@GoOz
GoOz / Modal.html
Created December 18, 2024 10:41
Modal JinjaX
<Modal variant="warning">
<ModalTitle level="h2">{% translate "Modal title" %}</ModalTitle>
{% translate "Modal body text goes here." %}
<ModalFooter>
<Button size="large" variant="secondary" icon="back">{% translate "Annuler" %}</Button>
<Button size="large" variant="primary" icon="save">{% translate "Sauvegarder" %}</Button>
</ModalFooter>
</Modal>
@GoOz
GoOz / modal.html
Created December 18, 2024 10:38
Modal HTML
<div class="modal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{% translate "Modal title" %}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>{% translate "Modal body text goes here." %}</p>
</div>
@GoOz
GoOz / frame.fish
Created November 26, 2023 22:20
Frame photos for Instagram
function frame --description 'Frame photos for Instagram'
set W (identify -format '%w' $argv)
set H (identify -format '%h' $argv)
set ratioLongest 1.2147
set ratioShortest 1.472
if test $W -gt $H
set NW (math -s 0 $W x $ratioLongest)
set NH (math -s 0 $H x $ratioShortest)
else if test $W -lt $H
@GoOz
GoOz / kss-doc.sublime-snippet
Last active March 31, 2018 16:56
KSS Documentation template for Sublime Text 3
<snippet>
<content><![CDATA[
// ${1:Top level description of the feature}
//
// ${2:A description.}
//
// Markup: ${3:<some markup with a specific {{modifier_class\}\} like class or a pseudo class >}
//
// ${5:.class} - ${6:description of the class state}
// ${7::pseudo} - ${8:description of the pseudo state}
@GoOz
GoOz / batcharge.py
Created October 17, 2014 23:00
batcharge
#!/usr/bin/env python
# coding=UTF-8
# saved to ~/bin/batcharge.py and from
# http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/#my-right-prompt-battery-capacity
#!/usr/bin/env python
# coding=UTF-8
import math, subprocess
p = subprocess.Popen(["ioreg", "-rc", "AppleSmartBattery"], stdout=subprocess.PIPE)
@GoOz
GoOz / online-check.sh
Created October 17, 2014 22:59
online-check
#!/bin/zsh
# Saved in ~/online-check.sh and in a cron job as:
# * * * * * ~/online-check.sh
local offline=`dig 8.8.8.8 +time=1 +short google.com A | grep -c "no servers could be reached"`
if [[ "$offline" == "0" ]]; then
rm ~/.offline
else
touch ~/.offline
@GoOz
GoOz / gooz.zsh-theme
Created October 17, 2014 22:58
ZSH Theme based on Agnoster
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
#
@GoOz
GoOz / Anchors bookmarklet
Created July 22, 2014 10:22
Display anchors bookmarklet
javascript:(function (){/* v2.2+ -- http://bit.ly/7akCur */function ls(u,c){var h=document.getElementsByTagName("head")[0];var s=document.createElement("script");s.src=u;var d=false;s.onload=s.onreadystatechange=function (){if(!d&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){d=true;c();s.onload=s.onreadystatechange=null;h.removeChild(s);}};h.appendChild(s);}var $;var loc=location.href;var anchorPos=location.href.lastIndexOf('#');if(anchorPos>-1){loc=loc.substring(0,anchorPos);/* if already has an anchor, it needs to be replaced */}function a(n,t){return '<a href="'+loc+'#'+n+'" title="'+t+': '+n+'" style="background-color: rgba(255,255,255,.5); color: black; font-size: 14px; line-height: 14px; border-radius: 7px; width: 14px; text-align: center; display: block; position: absolute; left: -20px; opacity: .5;">#</a>';}ls("http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js",function (){$=jQuery;$("a[name]").each(function (i){$(a(this.name,"NAME")).insertBefore(this);});$(