Skip to content

Instantly share code, notes, and snippets.

kurento-tutorial
kurento-tutorial
@walidum
walidum / index.html
Created April 25, 2021 09:43
Images slider HTML CSS JS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SLIDER IMAGES</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<div class="main">
@walidum
walidum / script.js
Created April 25, 2021 09:59
Slider
var images = [
'im01.jpg',
'im02.jpg',
'im03.jpg',
'im04.jpg',
'im05.jpg',
]
var cpt = 0
function change() {
@walidum
walidum / style.css
Created April 25, 2021 10:00
Slider style
body {
margin: 0;
}
.main {
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
@walidum
walidum / index.java
Created April 25, 2021 10:45
Swipe to Delete and Undo in Android RecyclerView
new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {
@Override
public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) {
return false;
}
@Override
public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int direction) {
NotificationData.Result deletedCourse = notificationList.get(viewHolder.getAdapterPosition());
int position = viewHolder.getAdapterPosition();
@walidum
walidum / CountryPipePipe.ts
Last active April 25, 2021 18:26
exemple of pipe for Countries abbreviations
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'country'
})
export class CountryPipe implements PipeTransform {
transform(value: any, args?: any): any {
switch (value) {
case 'dz' : return ' Algeria';
case 'be' : return ' Belgium';
case 'tn' : return ' Tunisia';
@walidum
walidum / listcountries.html
Created April 25, 2021 18:28
How to use angular pipe
< li>
< ol *ngFor="let country of countries">
{{country | country}}
</ol>
</li>
@walidum
walidum / angularpipes.ts
Last active April 25, 2021 18:57
For create a pipe with the cli use : ng g p pipeName
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: ‘pipeName'
})
export class PipeNamePipe implements PipeTransform {
transform(value: any, args?: any): any {
}
}
}
@walidum
walidum / exemple.ts
Last active April 25, 2021 19:01
init list of countries
ngOnInit() {
this.countries = ['dz','be','tn'];
}