Hello all.
This is an open request : does anyone know about equitable non-smart phones or laptops, ideally long lasting and for the laptops: easily repairable with open-source componants ?
I know about Fairphone, but I couldn't find anything similar for simpler "feature phones".
By the way, I stumbled upon their cost …
Since Spring 4.1, it is really easy to enable JSONP on an API controller:
@RestController
@RequestMapping(value = "/")
public class MyController {
@ControllerAdvice
static class JsonpAdvice extends AbstractJsonpResponseBodyAdvice {
public JsonpAdvice() {
super("callback"); // name of the query parameter to use
}
}
@RequestMapping(value = "/", method = RequestMethod.GET)
public MyAPIResult getStuff(...) {
...
}
}
There is no RFC …
What do you think of the following innocuous Python code ?
from gevent import monkey
monkey.patch_all(thread=False, select=False)
import requests
requests.get('http://i-do-not-exist.com')
print('THIS WILL NEVER BE PRINTED !!!')
Guess what ? The string message will never get printed :(
Simply remove the monkey.patch_all
line and you'll …
Last week, my father asked me if I could find make a backup of an old lovely voicemail message he had.
I wrote a short Python script to accomplis this:
twiml_url = 'https://handler.twilio.com/twiml/EH9515e9e0d2fb81f27d75a493225ae703'
client = Client(os.environ['TWILIO_ACCOUNT_SID'], os.environ['TWILIO_AUTH_TOKEN'])
client.calls.create(to='+33241XXXXXX …
In this blog post, I'm going to demonstrate how to reuse WiseMapping HTML+JS rendering engine to easily visualize...
text-based mindmaps like this one have many benefits they are readable as-it-is they don't require any tool to be edited they follow the UNIX tenets
For the impatient ones, here is …
This week I wrote a small Python script, that can generate a mindmap from a simple indented text input like this:
Winter december january february Spring march april may Summer june july august Autumn september october november
The command: ./graphviz_mindmap.py seasons.txt
.
The results, with various layout
parameters:
Another …
Recently I lost a lot of time on this. Hence I want to share a working solution, even if i cannot take the time to detail the issue.
I'm taking about writing reusable code for Jenkinsfiles : https://jenkins.io/doc/book/pipeline/shared-libraries/
One cannot simply use Groovy HTTPBuilder
, because …
Today I've been struggling to understand why this does not work in Firefox, but is OK in Chrome:
<html>
<head>
<meta charset="UTF-8">
<base href="/">
head>
<body>
<svg>
<symbol id="pretty-circle">
<circle cx="15" cy="15" r="10"/>
symbol>
<use xlink:href="#pretty-circle">use>
svg>
body>
html>
Here …
I love reveal.js. I've been using it for years. But the other day, I was badly bitten by its requirement on a local HTTP server.
What happenned was that I was invited to make a short presentation in a youth and cultural center. I had prepared some slides with …
Due to a long standing bug, no history file will be kept of the commands you enter in an interactive shell when using a Python 3 virtualenv.
I found out a simple workaround. Simply put the following in your ~/.pythonrc
:
import atexit, os, readline, sys
if sys.version_info >= (3, 0 …
Today, I did some tests on a server where an old version of our project was deployed. At some point, I needed to identify which version of the code was there, and I wrote a pretty shell function to figure this out.
Yeah, I know what your thinking : there must …
Last week, I made up a basic TCP server in Python, to receive log lines. To split log lines, I used the ascii line feed ascii character : \n aka 0xa in hexadecimal.
But then I wondered : could this byte appear elsewhere in the UTF8-encoded strings of text I was sending …
...in just one command :
cd path/to/your/git/repo
cat <<EOF >.git/hooks/pre-rebase
#!/bin/sh
echo -n \$'\x1b[36m' # start coloration (cyan)
curl -s https://raw.githubusercontent.com/jenkinsci/chucknorris-plugin/master/src/main/java/hudson/plugins/chucknorris/FactGenerator.java | sed '1,/FACTS = {/d;s/^ \+"//;s/"..\?$//;/^$/,$d …
In any UNIX shell, the following will always work out of the box:
browserify src/main/lib/js/*.js > out-bundle.js
But of course, not under Windows.
And browserify
does not accept directory names as primary parameter, nor wildcard globbing patterns. There is a pending issue & pull request aiming to …
Did you ever got this infamous error message in Firefox debug console (with CSS error messages enabled) ?
downloadable font: Layout: DFLT table doesn't satisfy the spec. for script tag DFLT (font-family: "MyBeautifulFont" style:normal weight:normal stretch:normal src index:1) source: http://W.X.Y.Z/fonts/myfont …
Python generators are awesome. Why ?
- their syntax is simple an concise
- they lazily generate values and hence are very memory efficient
- bonus point: since Python 3 you can chain them with
yield from
Their drawback ? They can be iterated only once, and they hide the iterable length.
I took an …
A year ago, I built a small JS lib using D3.js to visualize JSON-defined genealogy trees.
At the beginning of the year, I added a new feature using flex-calendar and moment-ferie-fr : a birthday calendar using the same JSON genealogy definition and miniature images.
I added this calendar to the …
First, lets mention Git Bash (aka msysgit) : the old version was a PITA to extend with additional packages (e.g. adding common C libs like libxml), and the new one (renamed Git for Windows), is based on MSYS2, but does not include a package manager.
Hence, we were left with …
... and the standard UNIX tool zipinfo
cannot display them !
So here is Python one-liner to extract them, and other useful meta informations:
python -c "import json, sys, zipfile; json.dump([{k: str(getattr(i, k)) for k in zipfile.ZipInfo.__slots__} for i in zipfile.ZipFile(sys.argv[1]).infolist …
I'm not really crazy about Yeoman's grunt-usemin : I find painful the way it enforces a unique pipeline, with its preliminary useminPrepare
task and :generated
targets.
But on the project I'm working on, we made the choice to use it early on, and we're sticking with it for now. And this …