Skip to content

Instantly share code, notes, and snippets.

View Phyks's full-sized avatar

Lucas Verney Phyks

View GitHub Profile
{
"modules": {
"skipped": [
"presseurop",
"mangareader",
"edf",
"mangago",
"adecco",
"indeed",
"googletranslate",
cozysdk.defineView(
'CozyInstance',
'all',
doc => emit(doc._id, doc),
error => error && console.error(error)
)
cozysdk.queryView('CozyInstance', 'all', {}).then(
res => console.log('Get CozyInstance', res)
);
@Phyks
Phyks / list.json
Created November 2, 2016 00:08
Weboob modules list as exported by cozyweboob.
{
"750g": {
"capabilities": "CapRecipe",
"config": {
},
"description": "750g French recipe website",
"icon": "",
"license": "AGPLv3+",
@Phyks
Phyks / modules.json
Created October 7, 2016 00:35
Weboob JSON modules export
{
"750g": {
"capabilities": "CapRecipe",
"config": {},
"description": "750g French recipe website",
"icon": "",
"license": "AGPLv3+",
"maintainer": "Julien Veyssier <[email protected]>",
"urls": "",
"version": 201606231055,
@Phyks
Phyks / models.md
Created October 5, 2016 02:22
Models description for cozy

Models

The Cozy datastore stores documents, which can be seen as JSON objects. A doctype is simply a declaration of the fields in a given JSON object, to store similar objects in an homogeneous fashion.

Cozy ships a built-in list of doctypes for representation of most of the common documents (Bills, Contacts, Events, ...).

Whenever your app needs to use a given doctype, you should:

  • Check if this is a standard doctype defined in Cozy itself. If this is the case, you should add a model declaration in your app containing at least the fields listed in the main fields list for this doctype. Note that you can extend the Cozy-provided doctype with your own customs fields. This is typically what is done in Konnectors for the Bill doctype.
  • If no standards doctypes fit your needs, you
<?php
$ampache_url = 'ampache.example.org:3689'; // EDIT ACCORDING TO YOUR NEEDS, DO NOT PUT ANY HTTP://
$request = $_SERVER['REQUEST_URI'];
$ch = curl_init();
// If there was a POST request, then forward that as well.
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
curl_setopt($ch, CURLOPT_POST, true);
% php test.php
--- Original
+++ New
...
-define('NO_SESSION','1');
...
- $params['object_id'] = $_REQUEST['object_id'];
+ $params['object_id'] = $_REQUEST['object_id'] + 1;
...
@Phyks
Phyks / google_now.py
Last active May 7, 2019 21:02
Fetch Google "Now" answers from the CLI. Usage: `python3 google_now.py QUERY`.
#!/usr/bin/env python3
import sys
import urllib.parse
import html2text
import scrapy
from scrapy.crawler import CrawlerProcess
results = []
% rofi -dump-xresources
! Enabled modi
rofi.modi: window,run,ssh
! Window opacity
rofi.opacity: 100
! Window width
rofi.width: 50
! Number of lines
rofi.lines: 15
! Number of columns
@Phyks
Phyks / workspace_back_and_forth_enhanced.py
Last active February 22, 2021 22:37
Enhanced back_and_forth for workspaces in i3.
#!/usr/bin/env python3
"""
Enhanced version of the workspace_back_and_forth of i3. Support a history of up
to 20 previously focused workspaces. See
https://www.reddit.com/r/i3wm/comments/40ncsn/window_back_and_forth_stack/
How to use:
* Put this file somewhere in your `$PATH`.
* In your `.i3/config` file, run the server on startup: