This file contains hidden or 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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
#Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
; dbd-launcher.ahk | |
; | |
; This script makes running DeadByDaylight on a widescreen monitor little less dumb. | |
; | |
; It does the following: |
This file contains hidden or 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 time | |
import praw | |
USERNAME = "" | |
PASSWORD = "" | |
CLIENT_ID = "" | |
CLIENT_SECRET = "" |
This file contains hidden or 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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
This file contains hidden or 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
// assert fails the test if the condition is false. | |
func assert(tb testing.TB, condition bool, msg string, v ...interface{}) { | |
if !condition { | |
_, file, line, _ := runtime.Caller(1) | |
fmt.Printf("\033[31m%s:%d: "+msg+"\033[39m\n\n", append([]interface{}{filepath.Base(file), line}, v...)...) | |
tb.FailNow() | |
} | |
} | |
// ok fails the test if an err is not nil. |
This file contains hidden or 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 logging | |
import time | |
import typing as T | |
from cProfile import Profile | |
log = logging.getLogger(__name__) | |
This file contains hidden or 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 base64 | |
import pickle | |
from django.contrib.sessions.models import Session | |
from django.utils.encoding import force_unicode | |
def decode_session_data(session_key): | |
"""Decode the data in a session object stored under ``session_key``. |
This file contains hidden or 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
{"lastUpload":"2022-01-25T01:47:36.730Z","extensionVersion":"v3.4.3"} |
This file contains hidden or 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
int REED_PIN = D0; | |
int MOTOR_PIN = D3; | |
int LED_PIN = D7; | |
int MOTOR_SPEED = 255; | |
void setup() { | |
pinMode(LED_PIN, OUTPUT); | |
pinMode(REED_PIN, INPUT_PULLUP); | |
pinMode(MOTOR_PIN, OUTPUT); | |
} |
This file contains hidden or 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
class Car(models.Model): | |
COLOR_CHOICES = ( | |
('RED', 'red'), | |
('WHITE', 'white'), | |
('BLUE', 'blue'), | |
) | |
color = models.CharField(max_length=5, choices=COLOR_CHOICES, default='RED') | |
# ... |
This file contains hidden or 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
{"lastUpload":"2018-07-05T17:21:35.097Z","extensionVersion":"v2.9.2"} |
NewerOlder