Skip to content

Instantly share code, notes, and snippets.

View ahdidou-mohamed's full-sized avatar

Mohamed AHDIDOU ahdidou-mohamed

View GitHub Profile

Conventinal Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

@ahdidou-mohamed
ahdidou-mohamed / MainActivity.kt
Created April 25, 2021 00:06 — forked from webserveis/MainActivity.kt
Implementar click RecyclerView Kotlin AndroidX
val mAdapter = MySimpleAdapter(dummyData())
recycler_view.setHasFixedSize(true)
recycler_view.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
recycler_view.adapter = mAdapter
mAdapter.setOnItemClickListener(object : MySimpleAdapter.ClickListener {
override fun onItemClick(v: View, position: Int) {
Log.v(TAG, "onItemClick ${position}")
@ahdidou-mohamed
ahdidou-mohamed / in_viewport.js
Created January 17, 2018 16:10 — forked from jjmu15/in_viewport.js
check if element is in viewport - vanilla JS. Use by adding a “scroll” event listener to the window and then calling isInViewport().
// Determine if an element is in the visible viewport
function isInViewport(element) {
var rect = element.getBoundingClientRect();
var html = document.documentElement;
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || html.clientHeight) &&
rect.right <= (window.innerWidth || html.clientWidth)
);
@ahdidou-mohamed
ahdidou-mohamed / Default-568h@2x.png
Created March 22, 2016 17:50 — forked from uebo/Default-568h@2x.png
iOS Sample Launch Screen File
Default-568h@2x.png
/*
* System Versioning Preprocessor Macros
*/
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
@ahdidou-mohamed
ahdidou-mohamed / build_dependencies.sh
Created November 9, 2012 16:05
Compile tesseract for iOS SDK 6.0
#!/bin/sh
# build.sh
GLOBAL_OUTDIR="`pwd`/dependencies"
LOCAL_OUTDIR="./outdir"
LEPTON_LIB="`pwd`/leptonica-1.69"
TESSERACT_LIB="`pwd`/tesseract-r775"
IOS_BASE_SDK="6.0"
IOS_DEPLOY_TGT="4.3"
@ahdidou-mohamed
ahdidou-mohamed / build_tesseract.sh
Created November 9, 2012 15:30 — forked from zbyhoo/build_tesseract.sh
Downloads and compiles Tesseract OCR library for iOS
#!/bin/sh
# build.sh
GLOBAL_OUTDIR="`pwd`/dependencies"
LOCAL_OUTDIR="./outdir"
LEPTON_LIB="`pwd`/leptonica-1.68"
TESSERACT_LIB="`pwd`/tesseract-3.01"
IOS_BASE_SDK="5.1"
IOS_DEPLOY_TGT="4.3"