Skip to content

Instantly share code, notes, and snippets.

View wolfv's full-sized avatar
🚀

Wolf Vollprecht wolfv

🚀
View GitHub Profile
@wolfv
wolfv / fetch.sh
Created September 8, 2021 13:08
Fetch from OCI registry (ghcr.io)
export TOKEN=$(curl --silent https://ghcr.io/token\?scope\=repository:wolfv/artifact:pull | jq -r .token)
curl \
--silent \
--request 'GET' \
--header "Authorization: Bearer $TOKEN" \
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
'https://ghcr.io/v2/wolfv/artifact/manifests/1.0'
echo "\n\nFetching image content now:\n\n"
@dmontagu
dmontagu / safe_arrays.py
Last active January 28, 2020 13:05
Proof of concept tracking numpy array data types and shapes
from typing import TYPE_CHECKING, Any, Generic, Tuple, Type, TypeVar, Union
import numpy as np
from typing_extensions import Literal
T = TypeVar("T")
S = TypeVar("S")
class Dimension(Generic[T]):
@mohamadaliakbari
mohamadaliakbari / ubuntu-run-dhclient-on-startup.md
Last active November 6, 2023 19:33
Run dhclient on Startup in Ubuntu 18.04

dhclient is the Dynamic Host Configuration Protocol (DHCP) Client one would use to allow a client to connect to a DHCP server.

$ sudo nano /etc/rc.local

#!/bin/bash
dhclient
exit 0
@jpivarski
jpivarski / xsimd.ipynb
Last active August 13, 2018 14:58
AVX-512 cumsum implementation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dtheodor
dtheodor / tagged_articles.py
Last active August 29, 2015 14:08
Tagging and retrieving versions of objects with arbitrary key/value.
from sqlalchemy_continuum import get_versioning_manager
class VersionBase(object):
"""Base class for SQL Alchemy continuum objects that supports tagging"""
@classmethod
def tag_current_transaction(cls, **kwargs):
"""Add keyword arguments that will be stored as a `TransactionMeta`
entry on next successful commit that includes versioned objects.
"""
@Zauberfisch
Zauberfisch / GridFieldPersonSalutationDropDown.php
Created March 3, 2013 20:51
GridField example inline/inrow Dropdown example (Changing a Persons Salutation)
<?php
class GridFieldPersonSalutationDropDown implements GridField_ColumnProvider, GridField_URLHandler {
public function augmentColumns($gridField, &$columns) {
$columns[] = 'Salutation';
}
public function getColumnsHandled($gridField) {
return array('Salutation');
}
@stojg
stojg / ss-upgrade.sh
Created August 14, 2012 22:16
Search and replace for SS 3.0 upgrade [beta]
function replace {
echo Replacing '"'$1'"' with '"'$2'"'
find . \( -path './framework' -o -path './cms' -o -path './.git' \) -prune -o -name '*.php' -exec grep -l "$1" {} \; | xargs sed -i "" 's/'"$1"'/'"$2"'/g'
}
replace 'Director::currentPage(' 'Director::get_current_page('
replace 'Member::currentMember(' 'Member::currentUser('
replace 'new DataObjectSet' 'new ArrayList'