Skip to content

Instantly share code, notes, and snippets.

@sh4nks
sh4nks / Dracula.sublime-color-scheme
Created February 4, 2021 14:37
Dracula Color Scheme customizations
// Documentation at https://www.sublimetext.com/docs/color_schemes.html
{
"variables":
{
},
"globals":
{
},
"rules":
@sh4nks
sh4nks / cli.py
Created December 9, 2020 09:23
flask shell with ipython
def get_version(ctx, param, value):
if not value or ctx.resilient_parsing:
return
message = (
"<project> %(version)s using Flask %(flask_version)s on "
"Python %(python_version)s"
)
click.echo(
message
% {
@sh4nks
sh4nks / audit_mixin.py
Created December 4, 2020 10:15 — forked from mjhea0/audit_mixin.py
Useful SQLAlchemy Mixins
from datetime import datetime
from sqlalchemy import Column, Integer, DateTime, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declared_attr
from flask_security import current_user
class AuditMixin(object):
created_at = Column(DateTime, default=datetime.now)
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now)
@sh4nks
sh4nks / dev_run.py
Created August 23, 2020 16:44 — forked from skariel/dev_run.py
hot reloading automation for sqlc, quicktemplates etc
#!python -u
import os
import sys
import glob
import time
import signal
import queue
from subprocess import Popen, getoutput, PIPE
from multiprocessing import Process, Queue
from watchdog.observers import Observer
@sh4nks
sh4nks / lv02.c
Created January 11, 2014 14:54
lv02
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
int calc_total(int numbers[], int len) {
int total = 0;
for(int i = 0; i < len; i++) {
total += numbers[i];
}
@sh4nks
sh4nks / app.py
Last active December 25, 2015 20:59
integrate flaskbb in another app
from flask import Flask
from werkzeug.serving import run_simple
from werkzeug.wsgi import DispatcherMiddleware
from flaskbb.user.models import User
from flaskbb import create_app as flaskbb
from flaskbb.configs.development import DevelopmentConfig as Config
from flask.ext.login import LoginManager
from flask.ext.sqlalchemy import SQLAlchemy
# MS Tracking
0.0.0.0 a.ads1.msn.com
0.0.0.0 a.ads2.msads.net
0.0.0.0 a.ads2.msn.com
0.0.0.0 a.rad.msn.com
0.0.0.0 a-0001.a-msedge.net
0.0.0.0 a-0002.a-msedge.net
0.0.0.0 a-0003.a-msedge.net
0.0.0.0 a-0004.a-msedge.net
diff -ur a/configure.ac b/configure.ac
--- a/configure.ac 2011-09-28 03:37:26.000000000 +0200
+++ b/configure.ac 2012-07-28 01:47:52.089090647 +0200
@@ -115,7 +115,6 @@
progs/demos/Makefile
progs/demos/One/Makefile
progs/demos/shapes/Makefile
- progs/demos/smooth_opengl3/Makefile
progs/demos/spaceball/Makefile
progs/demos/subwin/Makefile
# Maintainer: Nuno Araujo <nuno.araujo at russo79.com>
pkgname=gnome15
pkgver=0.8.4
pkgrel=5
pkgdesc="Gnome tools for the Logitech G Series Keyboards And Z-10 Speakers"
arch=(any)
url="http://www.gnome15.org"
license=('GPL')
depends=(python2 python-imaging python2-cairo dbus-python pygtk python2-pyinotify
python2-lxml pygobject pyxdg pyusb python2-rsvg python-xlib
@sh4nks
sh4nks / gist:3667783
Created September 7, 2012 17:00
ps -u $(whoami) output
PID TTY TIME CMD
2839 ? 00:00:00 gnome-keyring-d
2860 ? 00:00:00 gnome-session
2877 ? 00:00:00 dbus-launch
2878 ? 00:00:04 dbus-daemon
2883 ? 00:00:26 pulseaudio
2888 ? 00:00:00 gconf-helper
2890 ? 00:00:00 gconfd-2
2894 ? 00:00:00 ssh-agent
2896 ? 00:00:00 gvfsd