Skip to content

Instantly share code, notes, and snippets.

View n1k0's full-sized avatar
✏️
writing a github status

Nicolas Perriault n1k0

✏️
writing a github status
View GitHub Profile
@n1k0
n1k0 / shush-blocklist.txt
Last active December 3, 2020 14:39 — forked from adriantombu/shush-covid19.txt
A personal blocklist to be used with Shush! browser extension https://github.com/adriantombu/shush
patriote,
patriotes,
identitaire,
identitiares
@n1k0
n1k0 / fields.py
Created March 12, 2020 17:57 — forked from danni/fields.py
Multi Choice Django Array Field
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 / series.md
Last active August 14, 2018 20:02 — forked from twidi/series.md
series a voir
Title Seen Rating ★☆
24 ★★☆☆☆
Ash vs Evil Dead ?
Bates Motel ★★★☆☆
Battlestar Galactica ?
Better Call Saul ★★★★★
Black Mirror ★★★★★
Black Sails ?
Breaking Bad ★★★★★
<b>iframe</b>
@n1k0
n1k0 / page.html
Last active December 14, 2015 22:49
<html>
<head>
<title>My page</title>
<script>
window.onbeforeunload = function() {
alert('plop');
}
</script>
</head>
<body>
@n1k0
n1k0 / shortcuts.md
Last active December 10, 2015 07:28 — forked from lucasfais/gist:1207002

Sublime Text 2 - Useful Shortcuts (Mac OS X)

Forked from here, but let's use Markdown.

General

  • ⌘T go to file
  • ⌘⌃P go to project
  • ⌘R go to methods
  • ⌃G go to line
@n1k0
n1k0 / pre-commit.py
Created July 20, 2012 13:23 — forked from streeter/pre-commit.py
Python .git/hooks/pre-commit hook
#!/usr/bin/env python
import os
import re
import subprocess
import sys
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)')
CHECKS = [
@n1k0
n1k0 / casper.js
Created July 12, 2012 16:49 — forked from thom4parisot/casper.js
Bootstrap Dropdown CasperJS check.
casper.start('http://twitter.github.com/bootstrap/javascript.html#dropdowns', function() {
this.test.assertExists('#navbar-example');
this.click('#dropdowns .nav-pills .dropdown:last-of-type a.dropdown-toggle');
this.waitUntilVisible('#dropdowns .nav-pills .open', function() {
this.test.pass('Dropdown is open');
});
});
casper.run(function() {
this.test.done();
@n1k0
n1k0 / gist:1501173
Created December 20, 2011 10:44 — forked from fbuchinger/gist:1501115
PhantomJS: Capturing single dom elements as png files
var page = new WebPage(),
address, output, size;
//capture and captureSelector functions adapted from CasperJS - https://github.com/n1k0/casperjs
capture = function(targetFile, clipRect) {
var previousClipRect;
var clipRect = {top: 0, left:0, width: 40, height: 40};
if (clipRect) {
if (!isType(clipRect, "object")) {
throw new Error("clipRect must be an Object instance.");