Skip to content

Instantly share code, notes, and snippets.

View Mazyod's full-sized avatar
🤖
Unlocking LLMs

Maz Mazyod

🤖
Unlocking LLMs
View GitHub Profile
@webbertakken
webbertakken / .gitattributes
Last active November 1, 2024 04:45
.gitattributes for Unity projects
#
# Git attributes for Unity projects
#
# Compiled by the GameCI community under the MIT license - https://game.ci
#
# Latest version at https://gist.github.com/webbertakken/ff250a0d5e59a8aae961c2e509c07fbc
#
# Ensure that text files that any contributor introduces to the repository have their line endings normalized
* text=auto
@alexa-infra
alexa-infra / examples.py
Created May 22, 2020 21:27
Dialect-specific SQLAlchemy declarative Column defaults
class Table1(Base):
__tablename__ = 'table1'
id = sa.Column(UUID, primary_key=True, server_default=sa.text("uuid_generate_v4()"))
class Table2(Base):
__tablename__ = 'table2'
id = sa.Column(UUID, primary_key=True, default=uuid.uuid4)
import React, { Component } from 'react';
import PropTypes from 'prop-types';
const propTypes = {
text: PropTypes.string.isRequired,
customClass: PropTypes.string,
selectionHandler: PropTypes.func
};
/**
@Mazyod
Mazyod / watchdog.py
Last active April 13, 2019 15:26
Directory/files watchdog in Python
import os
import logging
from queue import Queue, Empty as EmptyQueue
from time import sleep
from threading import Thread
from typing import List
logger = logging.getLogger("watchdog")
@mrw34
mrw34 / postgres.sh
Last active October 16, 2024 22:51
Enabling SSL for PostgreSQL in Docker
#!/bin/bash
set -euo pipefail
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem
openssl rsa -in privkey.pem -passin pass:abcd -out server.key
openssl req -x509 -in server.req -text -key server.key -out server.crt
chmod 600 server.key
test $(uname -s) = Linux && chown 70 server.key
docker run -d --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -v "$(pwd)/server.crt:/var/lib/postgresql/server.crt:ro" -v "$(pwd)/server.key:/var/lib/postgresql/server.key:ro" postgres:12-alpine -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
@maciekish
maciekish / resetXcode.sh
Created August 10, 2016 10:13
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
open /Applications/Xcode.app
@heiswayi
heiswayi / Bindable.cs
Created June 5, 2016 21:32 — forked from btshft/Bindable.cs
Bindable class to reduce boilerplate code in mvvm (implement INotifyPropertyChanged)
namespace Helpers
{
///<summary>
/// Reduce mvvm boilerplate
///
/// Usage:
/// public class MyViewModel : Bindable {
/// // Now this property supports INotifyPropertyChanged
/// public string MyProperty
/// {
@mteece
mteece / timezone.md
Last active July 29, 2022 22:12
List of NSTimeZone Abbreviations and Names (iOS 9.3.1)

NSTimeZone - Timezone Abbreviations ADT = "America/Halifax"; AKDT = "America/Juneau"; AKST = "America/Juneau"; ART = "America/Argentina/Buenos_Aires"; AST = "America/Halifax"; BDT = "Asia/Dhaka"; BRST = "America/Sao_Paulo"; BRT = "America/Sao_Paulo"; BST = "Europe/London";

#Phoenix 1.1.x to 1.2.0 Upgrade Instructions

Project Generator

To generate new projects as 1.2.0, install the new mix archive:

mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez

Deps

@Humoud
Humoud / facts_rules.pl
Created March 21, 2016 07:14
Some notes I gathered on Prolog. Consider this a mini intro to Prolog. Will improve this gist as I continue to learn Prolog.
/*
To run this:
open command prompt execute 'swipl'
then run ['path/to/this/file.pl'].
then query away.
*/
% FACTS
likes(jana, omar).
likes(omar, jana).