This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Warning: converts file in place | |
# Usage: | |
# convert-heic kittens009142.heic | |
set -eu | |
if [ $# != 1 ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# ghost-add-user, (c) Martin Keegan 2021 | |
# Copyright licence: Apache Software Licence 2.0 | |
# A tool for adding new users to Ghost CMS from the command line | |
# please excuse this pre-alpha code. I was in a massive hurry. | |
import logging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
def batch_generator(size, g): | |
buffer = [] | |
try: | |
while True: | |
for i in range(0, size): | |
buffer.append(g.next()) | |
yield buffer | |
buffer = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Text_IO,Ada.Numerics.Generic_Elementary_Functions; | |
with Ada.Numerics; | |
use Text_IO,Ada.Numerics; | |
procedure Eutecticmain is | |
package Real_Io is new FLOAT_IO(Float); | |
use Real_Io; | |
package Integer_IO is new Text_IO.INTEGER_IO(Integer); use Integer_IO; | |
use Integer_Io; | |
package Elem_Fct is new Ada.Numerics.Generic_Elementary_Functions (Float); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Ada.Text_IO; use Ada.Text_IO; | |
with Ada.Command_Line; | |
with Ada.Containers.Vectors; use Ada.Containers; | |
package body Dynamic_Allocation_Experiment | |
is | |
type Side is (Left, Right); | |
package Side_Container is new Vectors (Natural, Side); | |
use Side_Container; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with Ada.Text_IO; use Ada.Text_IO; | |
with Ada.Command_Line; | |
with Ada.Unchecked_Deallocation; | |
package body Dynamic_Allocation_Experiment | |
is | |
type Side is (Left, Right); | |
type Side_Array is array (Integer range <>) of Side; | |
type Side_Array_Ptr is access Side_Array; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Leaves a transaction | |
p_group = models.PackageGroup.query.filter_by(name=id).first_or_404() | |
# Doesn't leave a transaction, if uncommented instead of above | |
#p_group = db.session.query(models.PackageGroup).filter_by(name=id).first() | |
del(p_group) | |
db.session.commit() |
NewerOlder