Skip to content

Instantly share code, notes, and snippets.

View Atefnouri's full-sized avatar

Atef Nouri Atefnouri

View GitHub Profile
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@Atefnouri
Atefnouri / index.html
Last active August 1, 2017 21:10
Dynamic Select Angular js
<!DOCTYPE html>
<html ng-app="myApp" ng-controller="MainCtrl">
<head>
<meta charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
</head>
<body>
<!DOCTYPE html>
<html ng-app="todo">
<head>
<meta charset="utf-8">
<style>
.done{
@Atefnouri
Atefnouri / app.module.ts
Last active April 9, 2019 07:42
Reactive Form (Default && Custom Validation )
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { HelloComponent } from './hello.component';
import { ContactFormComponent } from './contact-form/contact-form.component';
import { SignupFormComponent } from './signup-form/signup-form.component';
import { NewCourseFormComponent } from './new-course-form/new-course-form.component';
@Atefnouri
Atefnouri / app.component.html
Created April 9, 2019 07:26
Component With Input && Output
<favorite [is-favoried]="false" (change)="whenFavIsChanged($event)" ></favorite>
@Atefnouri
Atefnouri / app.module.ts
Created April 9, 2019 09:28
Template Driven Form && Validations
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { HelloComponent } from './hello.component';
import { ContactFormComponent } from './contact-form/contact-form.component';
import { SignupFormComponent } from './signup-form/signup-form.component';
import { NewCourseFormComponent } from './new-course-form/new-course-form.component';
@Atefnouri
Atefnouri / localestorage.ts
Last active April 9, 2019 16:07
Local Storage in JavaScript
/*
localStorage and sessionStorage accomplish the exact same thing
and have the same API, but with sessionStorage the data is persisted
only until the window or tab is closed,while with localStorage the data is persisted
until the user manually clears the browser cache or until your web app clears the data.
The examples in this post are for localStorage, but the same syntax works for sessionStorage.
*/
.subscribe(
(res) => {
console.log('HTTP response', res);
},
(err) => {
console.log('HTTP Error', err)
},
() => {
//remove packages
sudo apt autoremove
//remove cache
sudo apt autoclean
@Atefnouri
Atefnouri / file.text
Created June 6, 2019 13:45
Tommorw Taks
BackEnd [
1 - Change Concour Type to nVarchar(5)
2 - add get by cat method
//Get_Concour_By_Type
[Route("api/Concours/getByType/{_type}")]
[HttpGet()]
public IHttpActionResult getConcourbyType(string _type)
{