Skip to content

Instantly share code, notes, and snippets.

View dyohan9's full-sized avatar
:octocat:

Daniel Yohan dyohan9

:octocat:
View GitHub Profile
@vubon
vubon / models.py
Last active January 29, 2022 06:01
Django BRIN index in PostgreSQL Database
from django.contrib.postgres.indexes import BrinIndex
from django.db import models
class SampleData(models.Model):
created_at = models.DateTimeField()
class Meta:
"""
You must need to use PostgreSQL DB unless you can't use BrinIndex
"""
@Sharon-f
Sharon-f / speechrecognition.py
Created September 27, 2017 09:45
Python program to convert speech to text
import speech_recognition as sr
# obtain path to "Daily_English_Conversation_02_Do_you_speak_English.wav" in the same folder as this script
from os import path
AUDIO_FILE = path.join(path.dirname(path.realpath(__file__)), "Daily_English_Conversation_02_Do_you_speak_English.wav")
# use the audio file as the audio source
r = sr.Recognizer()
with sr.AudioFile(AUDIO_FILE) as source:namelist2.wav
print("Say something!")
@brianclements
brianclements / Commit Formatting.md
Last active May 21, 2024 09:54
Angular Commit Format Reference Sheet

Commit Message Format

This specification is inspired by and supersedes the [AngularJS commit message format][commit-message-format].

We have very precise rules over how our Git commit messages must be formatted. This format leads to easier to read commit history.

Each commit message consists of a header, a body, and a footer.

@econchick
econchick / gist:4666413
Last active December 22, 2023 13:32
Python implementation of Dijkstra's Algorithm
class Graph:
def __init__(self):
self.nodes = set()
self.edges = defaultdict(list)
self.distances = {}
def add_node(self, value):
self.nodes.add(value)
def add_edge(self, from_node, to_node, distance):