Skip to content

Instantly share code, notes, and snippets.

View kinnou02's full-sized avatar

Alexandre Jacquin kinnou02

View GitHub Profile
require 'spec_helper'
describe User do
it{ should have_field(:email).of_type(String) }
it{ should have_field(:username).of_type(String) }
it{ should have_field(:password_hash).of_type(String) }
it{ should have_field(:password_salt).of_type(String) }
it{ should have_field(:activation_token).of_type(String) }
@kinnou02
kinnou02 / gist:954940
Created May 4, 2011 08:43
the impossible is possible
==30038==
--30038-- VALGRIND INTERNAL ERROR: Valgrind received a signal 7 (SIGBUS) - exiting
--30038-- si_code=80; Faulting address: 0x0; sp: 0x4038a9dc0
valgrind: the 'impossible' happened:
Killed by fatal signal
==30038== at 0x38033154: unlinkBlock (m_mallocfree.c:245)
==30038== by 0x3803670D: vgPlain_arena_free (m_mallocfree.c:1518)
==30038== by 0x38062093: vgPlain_cli_free (replacemalloc_core.c:92)
==30038== by 0x38001D71: die_and_free_mem (mc_malloc_wrappers.c:123)
@kinnou02
kinnou02 / gist:7872124
Last active December 30, 2015 19:09
multibyte compliant substr
std::string substr(const std::string& str, size_t nb){
std::stringstream result;
auto it = str.begin();
unsigned char c;
size_t count = 0;
while(it != str.end() && count < nb){
c = *it;
result << c;
if(c >= 0xc0){
++it;
@kinnou02
kinnou02 / gist:8021247
Created December 18, 2013 12:07
"Sun Dec 09 2012" to date
#include <stdio.h>
#include <time.h>
main(){
char* date = "Sun Dec 09 2012";
struct tm tm = {0, 0, 0, 0, 0, 0, 0 ,0, 0};
strptime(date, "%a %b %d %Y", &tm);
time_t t = mktime(&tm);
printf("%d", t);
}
[root@mut-prd-tyr1.canaltp.prod] out: Requirement already up-to-date: wsgiref==0.1.2 in /usr/lib/python2.7 (from -r /tmp/tyr_requirements.txt (line 28))
[root@mut-prd-tyr1.canaltp.prod] out: Collecting setuptools (from Flask-SQLAlchemy==1.0->-r /tmp/tyr_requirements.txt (line 4))
[root@mut-prd-tyr1.canaltp.prod] out: Downloading setuptools-20.4-py2.py3-none-any.whl (508kB)
[root@mut-prd-tyr1.canaltp.prod] out: Installing collected packages: Flask-RESTful-master, setuptools
[root@mut-prd-tyr1.canaltp.prod] out: Running setup.py install for Flask-RESTful-master
[root@mut-prd-tyr1.canaltp.prod] out: Found existing installation: setuptools 20.3.1
[root@mut-prd-tyr1.canaltp.prod] out: Uninstalling setuptools-20.3.1:
[root@mut-prd-tyr1.canaltp.prod] out: Successfully uninstalled setuptools-20.3.1
[root@mut-prd-tyr1.canaltp.prod] out: Rolling back uninstall of setuptools
[root@mut-prd-tyr1.canaltp.prod] out: Exception:
py.test --doctest-modules (env: tartare)
============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /home/kinou/workspace/tartare, inifile:
collected 52 items / 4 errors
tests/helper_test.py .....
tests/integration/calendar_handle_test.py ....
tests/integration/update_data_test.py .....
tests/integration/mongo/contributors_api_test.py .............
version: '2'
services:
instances_configurator:
build: ./instances_configurator
volumes_from:
- tyr_beat
- tyr_worker
- jormungandr
volumes:
-- Afficahge de la boit de dialogue d'invitation --
function Dialog:show(text, yesLabel, noLabel, target, yesCallback, noCallback)
if not self.dialog then
self:init()
end
local dialog = self.dialog
-- Rend visible la boite de dialogue --
dialog:SetVisible(true)
self.dialogText:SetText(text)
test = {}
local context = UI.CreateContext("main")
local window = UI.CreateFrame("SimpleWindow", "window", context)
local inviteButton = UI.CreateFrame("RiftButton", "LuaPadloadButton", window)
-- Addon initialisation
@kinnou02
kinnou02 / .cvimrc
Last active December 30, 2018 14:51
set autoupdategist
let mapleader = "<Space>"
command g tabnew google
let searchengine searx = "https://searx.me/search?q="
let defaultengine = "google"
set numerichints
set typelinkhints