Instantly share code, notes, and snippets.

View CMakeLists.txt
include(CTest)
set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)
add_definitions(-fprofile-arcs -ftest-coverage)
link_libraries(gcov)
set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} --coverage)
add_custom_target(cov gcov ${CMAKE_CURRENT_SOURCE_DIR}/test_math_utils.c --object-directory ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/test_math_utils.dir WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
View Installer LAMP.md

Commandes que j'utilise pour installer LAMP

À adapter pour installer MariaDB. Remplaces apt-get par le package manager de ton système (ou installe apt ^^)

sudo apt-get -y install apache2 php7.2 libapache2-mod-php7.2 mysql-server mysql-client php7.2-mysql php7.2-mcrypt php7.2-intl phpmyadmin

Remplace 7.2 par 5.6 dans le nom des packages pour installer php5.6

View contacts.js
(function ( $ ) {
$("#phone")
.attr("href", atob("dGVsOjA3NTAyMjA5MDI="))
.find("strong")
.html(atob("MDcgNTAgMjIgMDkgMDI="))
;
$("#mail")
.attr("href", atob("bWFpbHRvOnJlbWkuYmxhaXNlQGdteC5mcg=="))
.find("strong")
.html(atob("cmVtaS5ibGFpc2VAZ214LmZy"))
View jquery.combobox.js
/*
* MIT License
*
* Copyright (c) 2017 Rémi Blaise
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
View inline_form.js
// Use the `inline-form` class to make a form inline and get it managed. Submittion is not handled.
// The element has to contain <div class="display-inline-form"></div> and <div class="edit-inline-form"></div>, containing what is displayed normally and the edit form.
// /!\ DataTable create new <td/> so inline forms are not handled! You have to listen to 'order.dt' in order to handle in-table forms.
handleInlineForm = function($, element){
var containers = element.find('.inline-form');
containers.each(function(i, container){
var display = $(container).find('.display-inline-form'),
View XMLRepr
#!/usr/bin/env python3
# -*-coding:Utf-8 -*
from textwrap import indent
from operator import itemgetter, attrgetter
class XMLRepr:
"""
Awesome XML representation base class
View inherit_docstring.py
"""
Inherit docstrings
Found here: http://code.activestate.com/recipes/578587-inherit-method-docstrings-without-breaking-decorat/
Simple Use:
1) Import this module
2) Inherit metaclass InheritableDocstrings
3) Apply decorator inherit_docstring
View inject_arguments.py
#!/usr/bin/env python3
# -*-coding:Utf-8 -*
# The MIT License (MIT)
#
# Copyright (c) 2016 Rémi Blaise <remi.blaise@gmx.fr> "http://php-zzortell.rhcloud.com/"
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
View memo.py
#!/usr/bin/python3.4
# -*-coding:Utf-8 -*
class Car:
"""A car"""
# Class attribute
model = "4x4"
View jquery.findby.js
jQuery(function($){
$.fn.findBy = function ( attr, value ) {
return this.find('[' + attr + '="' + value + '"]');
}
$.fn.filterBy = function ( attr, value ) {
return this.filter('[' + attr + '="' + value + '"]');
}
});