Skip to content

Instantly share code, notes, and snippets.

@amatellanes
amatellanes / celery.sh
Last active April 19, 2024 11:31
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
[
{
"Title": "Avatar",
"Year": "2009",
"Rated": "PG-13",
"Released": "18 Dec 2009",
"Runtime": "162 min",
"Genre": "Action, Adventure, Fantasy",
"Director": "James Cameron",
"Writer": "James Cameron",
@dev-zzo
dev-zzo / imperfect-design.md
Last active April 19, 2024 11:29
A curated list of research papers and blog posts on embedded security, keyed by the device p/n

The list below is compiled to inform, guide, and inspire budding security researchers. Oh and to pick something for bedtime reading too.

Included in the list are works on the following topics related to MCU/SoC security:

  • Secure boot
  • Fault injection
  • Side channel attacks

At the end of the list, there is also a section with links to articles of potential general interest, not addressing vulnerabilities in any specific device.

@rwjblue
rwjblue / run_loop_queues.md
Created October 12, 2013 21:24
Ember Run Loop Queues

The run loop in Ember starts off with three 'default' queues (sync, actions, destroy) setup here. A few additional queues (render and afterRender) are added by the ember-views package here. The ember-routing package also adds routerTransitions here.

You can see the list of run loop queues in your application along with their ordering by running Ember.run.queues in the console:

Ember.run.queues
["sync", "actions", "routerTransitions", "render", "afterRender", "destroy"]

Here is a little more detail about each queue (along with source references if available/known):

@diffficult
diffficult / bluetoothdoubledipping.md
Last active April 19, 2024 11:28
Bluetooth Pairing one device on Dual Boot of Windows & Linux - Stop having to Pair Devices

Bluetooth Pairing one device on Dual Boot of Windows & Linux - Stop having to Pair Devices

You may have experienced when dual booting that you need to re-pair your bluetooth devices (ie., Headphones, mouse, keyboard, etc) this usually happens because you have already paired the device with another operating system using the same bluetooth adapter when dual booting (either Linux or Windows).

Some devices cannot handle multiple pairings associated with the same MAC address (ie., bluetooth adapter). As per suggested on the ArchWiki you can fix this by re-pairing the device each time, but there's actually another solution to not do so each time you choose to use your device on a different OS.

How can we accomplish this?

Easy, just pair the device on a OS and copy the bluetooth keys generated to the other OS so our device doesn't notice the difference.

@cayter
cayter / repository.ts
Last active April 19, 2024 11:27
Drizzle ORM Type-Safe Repository With PgTable
import { startSpan } from "@sentry/remix";
import type { StartSpanOptions } from "@sentry/types";
import {
type AnyColumn,
type AnyTable,
type BuildQueryResult,
type DBQueryConfig,
type DrizzleTypeError,
type Equal,
type ExtractTablesWithRelations,
@davidhooey
davidhooey / oracle_wait_events_for_sqlid.sql
Created September 17, 2013 13:58
Oracle Wait Events for SQL_ID
-- Shared Pool
select
event,
time_waited "time_waited(s)",
case when time_waited = 0 then
0
else
round(time_waited*100 / sum(time_waited) Over(), 2)
end "percentage"
from
@WillianTomaz
WillianTomaz / wsl-info.md
Last active April 19, 2024 11:26
Instruções do WSL (Instalação, Backup e Restauração)

Instruções para Instalação, Backup e Restauração do WSL 2

  • Observação:

    • Sempre buscar pela documentação oficial, este documento é um tutorial
      que pode não te atender conforme tenha novas atualizações do processo de instalação.
    • As referências estão no final do documento.
  • Foi utilizado:

    • Windows 10
@igv
igv / adaptive-sharpen.glsl
Last active April 19, 2024 11:26
Optimal sharpening strength (according to objective metrics) - 0.5. Can be applied only to luma channel (change OUTPUT to LUMA). To use it on-demand add the following line to input.conf: n change-list glsl-shaders toggle "~~/adaptive-sharpen.glsl"
// Copyright (c) 2015-2021, bacondither
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer
// in this position and unchanged.
// 2. Redistributions in binary form must reproduce the above copyright
@igv
igv / SSimSuperRes.glsl
Last active April 19, 2024 11:26
Basically it's an accurate sharpener + antiringing. Usage: glsl-shader="~~/SSimSuperRes.glsl"
// SSimSuperRes by Shiandow
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3.0 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU