Skip to content

Instantly share code, notes, and snippets.

@eirenik0
eirenik0 / install_liquidsoap_latest.sh
Last active September 29, 2019 19:54 — forked from dtcooper/install_liquidsoap_latest.sh
Various Liquidsoap Install Scripts for Ubuntu 16.04 LTS
#!/bin/sh
sudo apt-get install -y build-essential git automake ocamlbuild
mkdir -p "$HOME/liquidsoap-build"
cd "$HOME/liquidsoap-build"
wget https://github.com/savonet/liquidsoap/releases/download/1.3.7/liquidsoap-1.3.7-full.tar.gz
tar xvzf liquidsoap-1.3.7-full.tar.gz
@eirenik0
eirenik0 / circle.yml
Created April 28, 2017 12:56 — forked from Yorkshireman/circle.yml
Installing Chrome on Circle CI machine (Ubuntu 14.04)
dependencies:
pre:
- sudo apt-get install libxss1 libappindicator1 libindicator7
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- sudo dpkg -i ./google-chrome*.deb
- sudo apt-get install -f
@eirenik0
eirenik0 / simple_websocket_client.html
Created December 29, 2016 07:46 — forked from geoffb/simple_websocket_client.html
Super simple websockets client/server using Python. Compatible with the draft 76 challenge/response.
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebSocket Client</title>
<style>
#output {
border: solid 1px #000;
}
</style>
</head>
@eirenik0
eirenik0 / setup_selenium.sh
Last active April 4, 2017 21:30 — forked from curtismcmullan/setup_selenium.sh
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in
from django.views.generic.base import View, TemplateResponseMixin
from django.views.generic.edit import FormMixin, ProcessFormView
class MultipleFormsMixin(FormMixin):
"""
A mixin that provides a way to show and handle several forms in a
request.
"""
form_classes = {} # set the form classes as a mapping
@eirenik0
eirenik0 / bobp-python.md
Created November 18, 2015 13:53 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@eirenik0
eirenik0 / scrapper.py
Last active August 29, 2015 14:20 — forked from madjar/scrapper.py
import asyncio
import aiohttp
import bs4
import tqdm
@asyncio.coroutine
def get(*args, **kwargs):
response = yield from aiohttp.request('GET', *args, **kwargs)
return (yield from response.read_and_close(decode=True))
@eirenik0
eirenik0 / fabfile.py
Last active August 29, 2015 14:15 — forked from dreamiurg/fabfile.py
from __future__ import with_statement
from fabric.api import local, settings, abort, run, cd, env, sudo
from fabric.colors import green as _green
from fabric.colors import yellow as _yellow
from fabric.colors import red as _red
from fabric.contrib.console import confirm
from fabric.contrib.project import rsync_project
from fabric.contrib.files import upload_template, exists
from fabric.operations import require
from fabric.context_managers import prefix

AngularJS best ressources

Following the AngularJS PARIS meetup (25/2 à 19h à Paris with @sampaccoud @dzen @_kemar @tchack13 @vinz et @revolunet)

Here's our best AngularJS ressources : twitter, github, articles & blogs. Please comment and add your good stuff !

from django.db.models.fields.related import ReverseSingleRelatedObjectDescriptor
def override_model_field(model, name, column, field):
"""Force override a field in a Django Model.
Usage: override_model_field(
MyModel, models.ForeignKey(OtherModel), 'other', 'other_id')
:type model: django.db.models.base.ModelBase
:type name: basestring
:type column: basestring
:type field: django.db.models.fields.Field