Skip to content

Instantly share code, notes, and snippets.

View mardix's full-sized avatar

Mardix mardix

View GitHub Profile
@mardix
mardix / OpenSourceBaas.md
Created June 29, 2023 03:35 — forked from PARC6502/OpenSourceBaas.md
List of open source, self hosted BaaS - Backend as a service

Backend as a Service

Supabase - ~52K stars

  • Designed explicitly as an open source firebase alternative
  • Typescript based
  • Docker support

Appwrite - ~32K stars

  • Written in JavaScript and PHP
  • Docker based
  • Realtime support across all services
@mardix
mardix / python_over_ssh
Created March 21, 2017 07:05 — forked from mattyjones/python_over_ssh
Execute a script located on a remote server over ssh using python
#! /usr/bin/env python
import secure
import pexpect
# the file containing the list of servers to log into
input_file = "script_list"
# The login creds
user = secure.USER
@mardix
mardix / awesome-php.md
Created November 2, 2012 14:34 — forked from ziadoz/awesome-php.md
Awesome PHP Libraries
@mardix
mardix / autocomplete.py
Created September 16, 2020 01:13 — forked from jedp/autocomplete.py
autocomplete.py - redis autocompleter
"""
A redis autocomplete example for multi-word phrases.
Based on:
Ruby original: http://gist.github.com/574044
Python original: https://gist.github.com/577852
See options below for usage
Requires http://github.com/andymccurdy/redis-py/
# coding=UTF-8
from __future__ import division
import re
# This is a naive text summarization algorithm
# Created by Shlomi Babluki
# April, 2013
class SummaryTool(object):
/**
* Produces a function which uses template strings to do simple interpolation from objects.
*
* Usage:
* var makeMeKing = generateTemplateString('${name} is now the king of ${country}!');
*
* console.log(makeMeKing({ name: 'Bryan', country: 'Scotland'}));
* // Logs 'Bryan is now the king of Scotland!'
*/
var generateTemplateString = (function(){
@mardix
mardix / DOMClass.js
Created December 8, 2018 21:23 — forked from Maksims/DOMClass.js
HTMLElement extension to add, remove, toggle, detect Classes.
HTMLElement = typeof(HTMLElement) != 'undefiend' ? HTMLElement : Element;
HTMLElement.prototype.addClass = function(string) {
if (!(string instanceof Array)) {
string = string.split(' ');
}
for(var i = 0, len = string.length; i < len; ++i) {
if (string[i] && !new RegExp('(\\s+|^)' + string[i] + '(\\s+|$)').test(this.className)) {
this.className = this.className.trim() + ' ' + string[i];
}
import sqlalchemy as sa
import sqlalchemy.orm as orm
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import scoped_session, sessionmaker
DBSession = scoped_session(sessionmaker())
class BaseMixin(object):
query = DBSession.query_property()
id = sa.Column(sa.Integer, primary_key=True)
@mardix
mardix / vhost.py
Created October 15, 2013 01:19 — forked from fideloper/vhost.py
#! /usr/bin/python
from sys import argv
from os.path import exists
from os import makedirs
from os import symlink
import getopt
#
# Show Usage, Output to STDERR
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|