Skip to content

Instantly share code, notes, and snippets.

View uzbekdev1's full-sized avatar
🌴
On vacation

Elyor Latipov uzbekdev1

🌴
On vacation
View GitHub Profile
@KarolinaCzo
KarolinaCzo / gist:72a356c19eb511ad8a7b4594bdfa159b
Last active October 16, 2023 18:13
Add @fortawesome/fontawesome-free to an Angular project
How to add Font Awesome @fortawesome/fontawesome-free to an Angular project?
1) Go to the project directory
2) Install Font Awesome as said on their website:
https://fontawesome.com/how-to-use/on-the-web/setup/getting-started?using=web-fonts-with-css
through npm: npm install --save @fortawesome/fontawesome-free
Use '--save' not '--save-dev'
3) Add Font Awesome to 'styles' in 'anguler.json':
@ginxx009
ginxx009 / Decrypt.cs
Created June 21, 2018 16:22
Encryption & Decryption MD5 C#
private void btnDecrypt_Click(object sender, EventArgs e)
{
byte[] data = Convert.FromBase64String(textBox4.Text); // decrypt the incrypted text
using (MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider())
{
byte[] keys = md5.ComputeHash(UTF8Encoding.UTF8.GetBytes(hash));
using (TripleDESCryptoServiceProvider tripDes = new TripleDESCryptoServiceProvider() { Key = keys, Mode = CipherMode.ECB, Padding = PaddingMode.PKCS7 })
{
ICryptoTransform transform = tripDes.CreateDecryptor();
byte[] results = transform.TransformFinalBlock(data, 0, data.Length);
@Toilal
Toilal / api.module.ts
Last active February 21, 2023 10:30
@auth0/angular2-jwt Authorization Service and HttpInterceptor supporting JWT Refresh Token (Angular 4.3+ & 5+)
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { JWT_OPTIONS, JwtInterceptor, JwtModule } from '@auth0/angular-jwt';
import { AuthorizationService } from './authorization.service';
import { environment } from '../../environments/environment';
import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
import { RefreshTokenInterceptor } from './refresh-token-interceptor';
function jwtOptionsFactory (authorizationService: AuthorizationService) {
return {
@dideler
dideler / bot.rb
Last active March 26, 2025 18:13
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
@ahmeti
ahmeti / only-number.directive.md
Last active September 18, 2024 02:44
Angular 5 - Only Number Input, Only Number Decimal
@krishna-acondy
krishna-acondy / query-options.ts
Created April 4, 2018 14:21
Query Options Type
export interface QueryBuilder {
toQueryMap: () => Map<string, string>;
toQueryString: () => string;
}
export class QueryOptions implements QueryBuilder {
public pageNumber: number;
public pageSize: number;
constructor() {
@t-palmer
t-palmer / web.config
Created March 27, 2018 21:09
Example IIS web.config file for Angular Router applications
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Angular Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
import {MatDialogModule} from "@angular/material";
@NgModule({
declarations: [
...
CourseDialogComponent
],
imports: [
...
function subsequent<T>(
count: number,
operator: (source: Observable<T>) => Observable<T>
): (source: Observable<T>) => Observable<T> {
return (source: Observable<T>) => new Observable<T>(observer => {
const published = source.pipe(publish()) as ConnectableObservable<T>;
const concatenated = concat(
published.pipe(take(count)),
published.pipe(operator)
);
@baditaflorin
baditaflorin / 30_under_30_europe_linkedin_info_final.csv
Created February 3, 2018 18:01
Forbes 30 under 30 Europe 2018 list containing 384 persosns. For 308 of them there is also the LinkedIn profile, if they have.
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 3.
Category were the 30 under 30 person was selected,Forbes Name,Forbes Age,Forbes Country,Role in the Company,Company,Description,LinkedIn Profile,linkedin_name,Exact match between the name ?,Did I had o perform a manual searh to find the linkedin profile ?
30 Under 30 - Europe - Social Entrepreneurs,Margherita Pagani,29,Argentina,Founder, Impacton.org,"Pagani aims to create an encyclopedia of blueprints for of purpose-driven projects for impact investing. The Italian-born and Argentina-based entrepreneur believes works with universities, governments and private companies to co-design programs based on proven models.",https://www.linkedin.com/in/magheritapagani,Margherita Pagani - CEO and Founder - Impacton.org ,FALSE,NO
30 Under 30 - Europe - Media & Marketing,Mohamed Khairat,25,Australia,Cofounders, Egyptian Streets,"Amin and Khairat founded Egyptian Streets back in 2012, less than two years after the Arab Spring. The digital publication that strives to address challenging issues--such as sexual harassment an