Skip to content

Instantly share code, notes, and snippets.

- name: create individual file symlinks from {{ this_deployment_scripts_fullname }} to the master
file: >-
dest=/usr/local/bin
src={{ ine_master_symlink }}/usr-local-bin/{{ item | basename }}
state=link
with_fileglob:
- "{{ this_deployment_scripts_fullname }}/usr-local-bin/*"
@ktosiek
ktosiek / gist:f9a5c667a2cba74e8671
Created July 23, 2014 11:46
Fun with object()
In [15]: class A(object):
....: pass
....:
In [16]: a = A()
In [17]: setattr(s, s, 10)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-17-a4e7f439dc1b> in <module>()
gerrit_test_utils: [1] ?- [gerrit_test_utils]. run_tests.
% gerrit_test_utils compiled into gerrit_test_utils 0.00 sec, 1 clauses
true.
% PL-Unit: with_facts .
Warning: /home/tomek/prolog/gerrit_test_utils.pl:16:
PL-Unit: Test multiple_facts: Test succeeded with choicepoint
done
% All 2 tests passed
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./date-time.nix
];
# ...
}

Keybase proof

I hereby claim:

  • I am ktosiek on github.
  • I am ktosiek (https://keybase.io/ktosiek) on keybase.
  • I have a public key whose fingerprint is 9D54 75B7 AA3F EE44 0CA6 555A 6063 DE48 8063 F1C0

To claim this, I am signing this object:

@ktosiek
ktosiek / loud.log
Last active September 23, 2016 15:33
>>> with client.capture_exceptions():
... print(1 + {})
@ktosiek
ktosiek / example.sql
Created June 1, 2017 21:19
primary key vs unique not null
create table unique_test (
id serial primary key,
u integer unique not null, text text
);
insert into unique_test select i as u, i as text
from generate_series(7, 10007) as i;
# explain verbose select u, text from unique_test group by id;
QUERY PLAN
-------------------------------------------------------------------------------
@ktosiek
ktosiek / graphql_raw_result.py
Created January 24, 2019 18:45
Return raw values from python graphql-core, skipping the complete_*_value functions.
import graphql.execution.executor
def complete_value(exe_context, return_type, field_asts, info, path, result):
if isinstance(result, RawGraphQLResult):
return result.value
return _complete_value(exe_context, return_type, field_asts, info, path, result)
class RawGraphQLResult:
def __init__(self, value):
self.value = value
@ktosiek
ktosiek / results.txt
Created August 25, 2019 19:18
Graphene: serialize 100k objects, v2 vs v3
Graphene 2: 6.852552616968751
Graphene 3: 15.776521055027843
@ktosiek
ktosiek / PA profile-set astro-a50-gen4.conf
Last active September 30, 2024 16:28
Astro A50 support on Linux - basic configuration for PulseAudio 13 (tested on Ubuntu's 13.99.1). Install the files and reboot, to make sure udev and PA reloaded :-)
; /usr/share/pulseaudio/alsa-mixer/profile-sets/astro-a50-gen4.conf
[General]
auto-profiles = yes
[Mapping analog-voice]
description = Voice
device-strings = hw:%f,0,0
channel-map = left,right
paths-output = steelseries-arctis-output-chat-common