Skip to content

Instantly share code, notes, and snippets.

Avatar
✏️
writing a github status

Nicolas Perriault n1k0

✏️
writing a github status
View GitHub Profile
@n1k0
n1k0 / fields.py
Created Mar 12, 2020 — forked from danni/fields.py
Multi Choice Django Array Field
View fields.py
from django import forms
from django.contrib.postgres.fields import ArrayField
class ChoiceArrayField(ArrayField):
"""
A field that allows us to store an array of choices.
Uses Django 1.9's postgres ArrayField
and a MultipleChoiceField for its formfield.
@n1k0
n1k0 / unblur.md
Last active Oct 22, 2020
Unblur bookmarlklet
View unblur.md

Unblur bookmarklet

Too many websites rely on the CSS blur filter to cheaply obfuscate contents. Here's a bookmarklet to reset all active blur styles from the current page DOM.

(function() {
  for (const x of document.querySelectorAll("*")) {
    const s = getComputedStyle(x);
    for (const k in s) {
      if (k.includes("filter") && s.filter.includes("blur")) {
@n1k0
n1k0 / app.js
Created May 22, 2019
head hunter email generator
View app.js
var villes = [
"Agen",
"Ajaccio",
"Albertville",
"Albi",
"Alençon",
"Alès",
"Amiens",
"Angers",
"Angoulême",
View .gitconfig
[alias]
caca = commit -a -C HEAD --amend
changelog = "!f() { r=${1:-`git describe --tags --abbrev=0`..HEAD}; echo Changelog for $r; git log --reverse --no-merges --format='* %s' $r; }; f"
changes = diff --name-status
ci = commit
cia = commit --amend
ciaa = commit -a --amend
co = checkout
cp = cherry-pick
dic = diff --cached
View .gitconfig
[alias]
caca = commit -a -C HEAD --amend
changelog = "!f() { r=${1:-`git describe --tags --abbrev=0`..HEAD}; echo Changelog for $r; git log --reverse --no-merges --format='* %s' $r; }; f"
changes = diff --name-status
ci = commit
cia = commit --amend
ciaa = commit -a --amend
co = checkout
cp = cherry-pick
dic = diff --cached
@n1k0
n1k0 / copy-to-clipboard.html
Last active Jul 9, 2018
Copy to clipboard for Chrome and Firefox
View copy-to-clipboard.html
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>copy to clipboard for chrome and firefox</title>
</head>
<body>
<button>copy</button>
<script>
function toClipoard(text) {
View demo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View keybase.md

Keybase proof

I hereby claim:

  • I am n1k0 on github.
  • I am n1k0 (https://keybase.io/n1k0) on keybase.
  • I have a public key ASBAtEJcRmxSj6XhdF7cyySIwHNXU--pLHpr6bkdytaQtAo

To claim this, I am signing this object:

@n1k0
n1k0 / Main.elm
Created Dec 14, 2016
Default Elm app
View Main.elm
module Main exposing (..)
import Html exposing (..)
main : Program Never Model Msg
main =
Html.program
{ init = createModel
, view = view
@n1k0
n1k0 / batch.js
Last active Sep 1, 2016
Quick kinto-http batch sample data creation script
View batch.js
var opts = {headers: {Authorization: "Basic " + require("btoa")("test:test")}};
var c = new (require("kinto-http"))("http://0.0.0.0:8888/v1", opts);
var schema = {"type": "object", "properties": {"n": {"type": "number"}}};
var displayFields = ["n"];
c.createBucket("buck")
.then(() => c.bucket("buck").createCollection("coll", {
data: {schema, displayFields}
}))
.then(() => {
You can’t perform that action at this time.