Skip to content

Instantly share code, notes, and snippets.

View dehuszar's full-sized avatar

Samuel Allen dehuszar

  • Ann Arbor, MI
  • 07:09 (UTC -04:00)
  • X @dehuszar
View GitHub Profile
Pipewire is the replacement for JACK and PulseAudio, Pipewire allows low latency compared to any pulseaudio tweaks
Here is a short list of what you should do to get the lowest latency in Osu!
Higher audio rate equals less latency always, unless you increase your quantum
to calculate node latency for your audio device take the quantum size divided by your audio rate
so 64/96000 = 0.00066666666 * 1000 = 0.6ms this is 0.6ms node latency
To check client latency use pw-top, take the quantum size and the audio rate of the client then use quantum / audio rate * 1000
to get overall latency for the client
@ruanbekker
ruanbekker / promtail_docker_logs.md
Last active May 31, 2024 23:52
Docker Container Logging using Promtail
@Pwntus
Pwntus / serverless.yml
Created May 18, 2017 19:45
SLS Cognito
resources:
Resources:
# User Pool
MyUserPool:
Type: AWS::Cognito::UserPool
Properties:
AdminCreateUserConfig:
AllowAdminCreateUserOnly: False
InviteMessageTemplate:
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
router: Ember.computed(function() {
return Ember.getOwner(this).lookup('router:main');
}),
zeCurrentRoute: Ember.computed.alias('router.currentRouteName')
@BrianSipple
BrianSipple / ember-addon-essentials.md
Last active April 17, 2017 18:27
Ember Addon Essentials -- A checklist of some of the finer details to keep in mind when developing Ember addons

Ember Addon Essentials

This document is meant to be a brief "checklist" of things to setup for your Ember addon when beginning development in order to have the best possible architecture and workflow out of the gate. For more comprehensive material, the following are bookshelf-caliber:

Filling out package.json

_extractRelationshipErrors: function(store, typeClass, payload) {
var relationshipNames = Ember.get(typeClass, 'relationshipNames'); //returns obj with key hasMany and belongsTo arrays of names.
var relationshipsByName = Ember.get(typeClass, 'relationshipsByName'); //returns object with key, kind, and typeClass
var relationTypes = ['hasMany', 'belongsTo'];
relationTypes.forEach(function(relationType) {
relationshipNames[relationType].forEach(function(relationshipName) {
var relationship = relationshipsByName.get(relationshipName);
if (payload.hasOwnProperty(relationshipName)) {
for (var i = 0; i < payload[relationshipName].length; i++) {
@MrNice
MrNice / blogpost.md
Last active February 17, 2023 09:46
Explain how to think about ansible and how to use it

Ansible

Understanding Ansible

Ansible is a powerful, simple, and easy to use tool for managing computers. It is most often used to update programs and configuration on dozens of servers at once, but the abstractions are the same whether you're managing one computer or a hundred. Ansible can even do "fun" things like change the desktop photo or backup personal files to the cloud. It can take a while to learn how to use Ansible because it has an extensive terminology, but once you understand the why and the how of Ansible, its power is readily apparent.

Ansible's power comes from its simplicity. Under the hood, Ansible is just a domain specific language (DSL) for a task runner for a secure shell (ssh). You write ansible yaml (.yml) files which describe the tasks which must run to turn plain old / virtualized / cloud computers into production ready server-beasts. These tasks, in turn, have easy to understand names like "copy", "file", "command", "ping", or "lineinfile". Each of these turns into shell comma

@eliotsykes
eliotsykes / current-route-query-params-ember-component.js
Last active November 13, 2019 13:06
How to get the current route, queryParams, etc. in an Ember component
// Examples
// Yes, "router.router" twice - this assumes that the router is being injected
// into the component. Otherwise lookup 'router:main'
// One of these will be of interest, figure out which one you want:
this.get('router.router.state');
this.get('router.router.state.params');
this.get('container').lookup('controller:application').currentPath;
@jonathantneal
jonathantneal / clone.js
Created July 21, 2015 16:11
PostCSS raw clone method
function clone(node, deep, keepParent) {
if (typeof node !== 'object') return node;
var cloned = new node.constructor();
Object.keys(node).forEach(function (key) {
var value = node[key];
if (keepParent && key === 'parent' || key === 'source') cloned[key] = value;
else if (value instanceof Array) cloned[key] = deep ? value.map(function (child) {
@poteto
poteto / search.js
Last active January 24, 2017 19:52
simple text search computed property macro
// utils/computed/search.js
import Ember from 'ember';
var computed = Ember.computed;
export default function search(dependentKey, propertyKey, searchQueryKey, returnEmptyArray) {
returnEmptyArray = (typeof returnEmptyArray === "undefined") ? false : returnEmptyArray;
return computed("" + dependentKey + ".@each." + propertyKey, searchQueryKey, function() {
var items, query;
if (returnEmptyArray && !this.get(searchQueryKey)) {
return Ember.A([]);