Skip to content

Instantly share code, notes, and snippets.

View samirthebti's full-sized avatar
🎯
Focusing

Samir Thebti samirthebti

🎯
Focusing
View GitHub Profile
@samirthebti
samirthebti / stomp-client.ts
Created June 5, 2018 15:29 — forked from ccarrasc/stomp-client.ts
Stomp client wrapped in Angular Service
import { Injectable } from '@angular/core';
import { Observable, Observer, BehaviorSubject, ReplaySubject } from 'rxjs/Rx';
import * as SockJS from 'sockjs-client';
import { Client, Frame, Stomp } from 'stompjs';
const DEFAULT_CACHE_SIZE: number = 100;
class TopicSubscription {
public subscription: any = null;
public subject: ReplaySubject<any>;
@samirthebti
samirthebti / TestPurchase.py
Created November 15, 2017 09:59 — forked from gdgellatly/TestPurchase.py
Sample Hypothesis Test File for Openerp v7
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP / Odoo, Open Source Management Solution - module extension
# Copyright (C) 2014- O4SB (<http://openforsmallbusiness.co.nz>).
# Author Graeme Gellatly <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
import UIKit
import RxSwift
import RxCocoa
let requiredUserNameLength = 5
let requiredPasswordLength = 5
let limitUserNameLength = 20
class ValidationViewController: UIViewController {
@samirthebti
samirthebti / ItemClickSupport.java
Created October 2, 2016 22:57 — forked from nesquena/ItemClickSupport.java
Click handling for RecyclerView
/*
Source: http://www.littlerobots.nl/blog/Handle-Android-RecyclerView-Clicks/
USAGE:
ItemClickSupport.addTo(mRecyclerView).setOnItemClickListener(new ItemClickSupport.OnItemClickListener() {
@Override
public void onItemClicked(RecyclerView recyclerView, int position, View v) {
// do it
}
});
@samirthebti
samirthebti / Android Studio .gitignore
Created October 1, 2016 20:50 — forked from iainconnor/Android Studio .gitignore
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files