Skip to content

Instantly share code, notes, and snippets.

View arischow's full-sized avatar
🐈
Focusing with my kittens Loki, Kasumi and Miumiu

Aris Chow arischow

🐈
Focusing with my kittens Loki, Kasumi and Miumiu
View GitHub Profile
@tindy2013
tindy2013 / _subconverter_configs.md
Last active May 9, 2024 05:57
subconverter_configs

This is a gist repository for some external configs for subconverter, you can use the raw address of the following INIs to generate a specified set of rules, groups and/or scripts.

@magicdude4eva
magicdude4eva / zsh-syntax-highlighting paste performance improvement
Last active May 6, 2024 08:10
zsh-syntax-highlighting paste performance improvement
Add the following in .zshrc:
...
plugins=(osx git zsh-autosuggestions zsh-syntax-highlighting zsh-nvm docker kubectl)
...
### Fix slowness of pastes with zsh-syntax-highlighting.zsh
pasteinit() {
OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
import asyncio
loop = asyncio.get_event_loop()
async def hello():
await asyncio.sleep(3)
print('Hello!')
if __name__ == '__main__':
loop.run_until_complete(hello())
@0xjac
0xjac / private_fork.md
Last active May 22, 2024 11:28
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@vsouza
vsouza / .bashrc
Last active April 9, 2024 05:27
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@danielthiel
danielthiel / SQLAlchemy_cast.py
Last active February 12, 2021 13:06
SQLAlchemy: filter by date for an datetime field(does not work with SQLite, with PostgreSQL it works fine)
from datetime import date
from sqlalchemy import cast, DATE
Match.query.filter(cast(Match.date_time_field, DATE)==date.today()).all()
@fanzeyi
fanzeyi / v2ex_api.md
Last active April 29, 2024 08:43
V2EX API
@mrjoes
mrjoes / ckedit.py
Created March 18, 2013 19:04
Flask-Admin and CKEditor WYSIWYG textarea integration. Basically, all you have to do: 1. Create new wtforms widget which will emit 'ckeditor' class 2. Make new wtforms field which will use this widget 3. Create new jinja2 template, which includes ckeditor javascript 4. Tell flask-admin to use new field and new template
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext import admin, wtf
from flask.ext.admin.contrib import sqlamodel
app = Flask(__name__)
app.config['SECRET_KEY'] = '123456790'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///test.sqlite'
db = SQLAlchemy(app)
@aubricus
aubricus / __init__.py
Last active November 27, 2022 01:19 — forked from yuvadm/fabfile.py
Using Fabric to connect to the remote server via an ssh config.
from fabric.api import env
env.use_ssh_config = True
env.forward_agent = True
env.roledefs = {
# key # hostname from config
'foo': ['foo.production'],
}
@ratchit
ratchit / gist:3942066
Created October 23, 2012 22:23
Flask MethodView decorators for individual request methods
from flask.views import MethodView
class MethodView(MethodView):
_decorators = {}
def dispatch_request(self, *args, **kwargs):
"""Derived MethodView dispatch to allow for decorators to be
applied to specific individual request methods - in addition