Skip to content

Instantly share code, notes, and snippets.

View EpocDotFr's full-sized avatar

Maxime Gross EpocDotFr

View GitHub Profile
@chaoflow
chaoflow / model.py
Created April 20, 2017 10:26
sqlite WITHOUT ROWID with (flask-)sqlalchemy
import flask_sqlalchemy
from sqlalchemy import schema
from sqlalchemy.ext.compiler import compiles
db = flask_sqlalchemy.SQLAlchemy()
class Tag(db.Model):
__table_args__ = {'info': {'without_rowid': True}}
text = db.Column(db.String, primary_key=True)
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@noelboss
noelboss / git-deployment.md
Last active April 25, 2024 10:38
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@BaptisteDixneuf
BaptisteDixneuf / OVH_Public_Cloud_Storage_API_OpenStack_Swift.md
Created June 25, 2015 21:23
OVH Public Cloud Object Storage et API OpenStack Swift
@pyguerder
pyguerder / Django-on-OVH-tutorial.md
Last active March 12, 2023 16:01
Installation de Django sur un hébergement mutualisé OVH

La méthode présentée ici permet d'installer un site Django sur un hébergement mutualisé OVH.

Lisez d'abord le fichier README puis copiez les fichiers .htaccess et django.cgi vers votre hébergement, ainsi que le code source de Django et le code source de votre site web.

// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@simonw
simonw / gist:7000493
Created October 15, 2013 23:53
How to use custom Python JSON serializers and deserializers to automatically roundtrip complex types.
import json, datetime
class RoundTripEncoder(json.JSONEncoder):
DATE_FORMAT = "%Y-%m-%d"
TIME_FORMAT = "%H:%M:%S"
def default(self, obj):
if isinstance(obj, datetime.datetime):
return {
"_type": "datetime",
"value": obj.strftime("%s %s" % (
@jazzsequence
jazzsequence / bootstrap_link_pages.php
Created October 3, 2013 17:58
Bootstrapping wp_link_pages - a wp_link_pages alternative for Twitter Bootstrap support. Based on code found here: http://wordpress.stackexchange.com/questions/14406/how-to-style-current-page-number-wp-link-pages