Skip to content

Instantly share code, notes, and snippets.

View quoidautre's full-sized avatar

Dark Passenger quoidautre

View GitHub Profile
@quoidautre
quoidautre / django_create_user.gist
Created November 8, 2021 13:25 — forked from makeittotop/django_create_user.gist
Create / remove user / superuser in a django app
>>> from django.contrib.auth.models import User
# Create a regular user 'foo'
>>> user = User.objects.create_user('foo', 'foo.bar@xxx.com', 'bar')
# List all users
>>> User.objects.all()
[<User: admin>, <User: abegail>, <User: foo>]
>>> User.objects.all()[1].is_superuser
### Keybase proof
I hereby claim:
* I am quoidautre on github.
* I am thedarkpassenger (https://keybase.io/thedarkpassenger) on keybase.
* I have a public key ASDiBnDXkUwmDe_9fwUzr_u6iOXl1K3-Ic3xoRoGL-J8ywo
To claim this, I am signing this object:
### Keybase proof
I hereby claim:
* I am quoidautre on github.
* I am thedarkpassenger (https://keybase.io/thedarkpassenger) on keybase.
* I have a public key ASBRYDmyWgEjpBr8Kr7fDb67sj0IGEw7NNbWi1VVLA1jfwo
To claim this, I am signing this object:
@quoidautre
quoidautre / plate-snitch.js
Created September 9, 2017 19:56 — forked from taitems/plate-snitch.js
Image processing to identify license plate
openalpr.IdentifyLicense(imagePath, function (error, output) {
// handle result
});
@quoidautre
quoidautre / plate-snitch.js
Created September 9, 2017 19:55 — forked from taitems/plate-snitch.js
(Extract) Check the status of a vehicle registration and scrape results.
// Open form and submit enquire for `rego`
function getInfo(rego) {
horseman
.userAgent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0')
.open(url)
.type('#registration-number-ctrl input[type=text]', rego)
.click('.btn-holder input')
.waitForSelector('.ctrl-holder.ctrl-readonly')
.html()
.then(function(body) {
@quoidautre
quoidautre / gist:2e67ffc29f6d1353650f0f2be9e956af
Created August 10, 2017 08:39
[javascript opp] Cash Register
function StaffMember(name,discountPercent){
this.name = name;
this.discountPercent = discountPercent;
}
var sally = new StaffMember("Sally",5);
var bob = new StaffMember("Bob",10);
// Create yourself again as 'me' with a staff discount of 20%
console.clear();
var Person = function() {};
Person.prototype.initialize = function(name, age)
{
this.name = name;
this.age = age;
}
// TODO: create the class Teacher and a method teach
HTML :
<html>
<form method="post" action="connexion.php">
<input type="texte" name="pseudo" />
<input type="submit" value="Connexion" />
</form>
</html>
PHP :
<?php
http://www.assessmentee.com/test/module/PHP
http://www.skilly.com
http://testingcenter.people-centric.fr/tests-recrutement-it-coding.html
http://www.ligams.com/media/examens/test-php-intermediaire
https://www.proprofs.com/quiz-school/story.php?title=test-php_2
https://www.proprofs.com/quiz-school/story.php?title=test-de-recrutement-dveloppeur-web
https://www.proprofs.com/quiz-school/story.php?title=professional-test-php-web-developers
http://www.tigersun.fr/test-php
http://www.ligams.com/media/examens/test-php-intermediaire2
https://www.proprofs.com/quiz-school/story.php?title=php-programming-quiz
@quoidautre
quoidautre / gist:7dab20bc772c6d8e41d28e26017255ba
Last active July 10, 2017 17:02
Issue in vagrant box, using Symfony
$ sfconsole cache:clear -vvv
18:59:29 DEBUG [php] Warning: rmdir(/var/www/formation/symfony-blog/var/cache/de~/translations): Directory not empty
[
"exception" => Symfony\Component\Debug\Exception\SilencedErrorContext {
-severity: E_WARNING,
trace: {
/var/www/formation/symfony-blog/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:174: {
: ,
: if (!@rmdir($file) && file_exists($file)) {,
: $error = error_get_last();