Skip to content

Instantly share code, notes, and snippets.

View raphaelfruneaux's full-sized avatar

Raphael Fruneaux raphaelfruneaux

View GitHub Profile
@raphaelfruneaux
raphaelfruneaux / mongo-cheat-sheet.md
Last active May 29, 2022 18:10
MongoDB - Dumping and Restoring

Mongo Cheat Sheet

Dump db

Mongo Shell

export MONGO_HOST=
export MONGO_USER=
export MONGO_PWD=
@raphaelfruneaux
raphaelfruneaux / audit_mixin.py
Created December 9, 2018 21:38 — forked from techniq/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)
@raphaelfruneaux
raphaelfruneaux / install-docker-master.sh
Created October 23, 2018 23:40 — forked from alexellis/install-docker-master.sh
install docker engine for swarm3k on Ubuntu 16.04. 2 options for installing
#!/bin/sh
# option 2: paste this into user-data to automate install via boot script
# NOTE: update --label=owner=YOURNAME below if you want to easily identify yours
# renames the host to have a suffix of alexellisio
export original=$(cat /etc/hostname)
sudo hostname $original-master-alexellisio
echo $original-master-alexellisio | sudo tee /etc/hostname
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
@raphaelfruneaux
raphaelfruneaux / events.py
Created August 11, 2018 01:30
Sample of socket events
# def on_my_event(self, message):
# session['receive_count'] = session.get('receive_count', 0) + 1
# emit('my_response',
# {'data': message['data'], 'count': session['receive_count']})
# def on_my_broadcast_event(self, message):
# session['receive_count'] = session.get('receive_count', 0) + 1
# emit('my_response',
# {'data': message['data'], 'count': session['receive_count']},
# broadcast=True)
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
@raphaelfruneaux
raphaelfruneaux / docker-rm.sh
Created July 17, 2018 20:15
Docker Snippets
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@raphaelfruneaux
raphaelfruneaux / gist:df9edd83f96a3cad7316424d7dae3104
Created April 4, 2018 00:33 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:

Nome completo

Raphael Goes Fruneaux

Localidade

Salvador / Bahia

Apresentação

@raphaelfruneaux
raphaelfruneaux / slack_history.py
Created February 9, 2018 18:06 — forked from Chandler/slack_history.py
Download Slack Channel/PrivateChannel/DirectMessage History
# MIT License
# Copyright (c) 2016 Chandler Abraham
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
// Código em parceria com @jroqueweb
function cssEngine(rule) {
var css = document.createElement('style'); // Creates <style></style>
css.type = 'text/css'; // Specifies the type
if (css.styleSheet) css.styleSheet.cssText = rule; // Support for IE
else css.appendChild(document.createTextNode(rule)); // Support for the rest
document.getElementsByTagName("head")[0].appendChild(css); // Specifies where to place the css
}