Skip to content

Instantly share code, notes, and snippets.

View nilsFK's full-sized avatar
🏠
Working from home

Nils F. Karlsson nilsFK

🏠
Working from home
View GitHub Profile
@benlinton
benlinton / multiple_mysql_versions_for_development.md
Last active September 5, 2024 07:31
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.

# -*- coding: utf-8 -*-
"""
Flask-Login example
===================
This is a small application that provides a trivial demonstration of
Flask-Login, including remember me functionality.
:copyright: (C) 2011 by Matthew Frazier.
:license: MIT/X11, see LICENSE for more details.
"""
@hmbilal
hmbilal / README.md
Last active June 18, 2019 15:05
Long polling service in AngularJS

Then in your controller, inject $polling and start polling like this.

General use

$polling.startPolling({name_of_this_polling}, {url_to_fetch_data_from}, {time_in_milli_seconds}, {callback});

Example,

$polling.startPolling('fetchNotifications', 'http://localserver.local/fetch/notifications', 10000, $scope.processData);

@nilsFK
nilsFK / Preferences.sublime-settings
Last active August 29, 2015 14:18
Sublime 3 user preferences
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme",
"default_line_ending" : "unix",
"font_options": "subpixel_antialias",
"font_size": 14,
"gutter" : true,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
@nilsFK
nilsFK / SublimeLinter.sublime-settings
Last active July 23, 2018 16:15
SublimeLinter settings for Sublime3+htmltidy+Angular
{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Danish Royalty/Danish Royalty.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "load/save",
"linters": {
"htmltidy": {
@qgerome
qgerome / diff_freeze.py
Created May 9, 2014 08:52
How to compare or diff 2 pip freeze or 2 requirements.txt in Python
"""
pip install click
"""
import click
import itertools
@nilsFK
nilsFK / Git Aliases
Last active August 29, 2015 14:00
GIT aliases
[alias]
# Basic commands
ignored = git ls-files -v | grep \"^[[:lower:]]\"
st = status -s
stat = status
ci = commit
co = checkout
br = branch
brav = branch -av
unstage = reset HEAD --
/sbin/ifconfig en0 ether $(/usr/bin/openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
@bkdinoop
bkdinoop / login-example
Last active May 21, 2024 06:25
Flask-Login : login.py created by https://github.com/maxcountryman : Matthew Frazier
# -*- coding: utf-8 -*-
"""
Flask-Login example
===================
This is a small application that provides a trivial demonstration of
Flask-Login, including remember me functionality.
:copyright: (C) 2011 by Matthew Frazier.
:license: MIT/X11, see LICENSE for more details.
"""
@utek
utek / Exclude_tables.md
Last active June 6, 2024 08:11
Define ignored tables in alembic.ini

Add this in your ini file:

[alembic:exclude]
tables = spatial_ref_sys

In env.py:

    import re