Skip to content

Instantly share code, notes, and snippets.

View technoknol's full-sized avatar
🎯
Focusing

Technoknol technoknol

🎯
Focusing
View GitHub Profile
@technoknol
technoknol / resursive-relation-to-self-model-laravel.php
Last active January 28, 2023 07:21
Recursive to self model (Recursive Children and Recursive Parents) - Laravel
<?php
/**
* @property float $wallet
* @property string $name
*/
class User extends Authenticatable
{
/**
* @return BelongsTo
@technoknol
technoknol / gist:43076ad7beb206b62f4e7b1150704839
Created June 22, 2022 12:40
Get all files added/changed so far by author name
git log --author="technoknol" --name-status --diff-filter=A --format='> %aN' | awk '/^>/ {tagline=$0} /^A\t/ {print tagline "\t" $0}' > changes.txt
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>Working file for fiber map.kmz</name>
<StyleMap id="msn_ylw-pushpin0">
<Pair>
<key>normal</key>
<styleUrl>#sn_ylw-pushpin</styleUrl>
</Pair>
<Pair>
@technoknol
technoknol / Sources
Last active December 15, 2021 07:19
VSCode firaCode iScript
https://thomasventurini.com/articles/setup-firacodeiscript-for-italic-fonts-in-vscode/
https://github.com/kencrocken/FiraCodeiScript
https://devdojo.com/tnylea/adding-cursive-fonts-to-vs-code
@technoknol
technoknol / Doctrine SubQuery using getDQL .php
Last active May 18, 2021 18:10
Doctrine SubQuery using getDQL
<?php
$queryBuilder = $this->entityManager->createQueryBuilder();
$queryBuilder2 = $this->entityManager->createQueryBuilder();
$subQuery = $queryBuilder2->select('COUNT(fr.status)')
->from(FeedbackRequest::class, 'fr')
->where('fr.giverId = iu.userId')
->groupBy('fr.status')
@technoknol
technoknol / custom-selector-redux-toolkit.js
Created May 3, 2021 19:45
Custom Selector Redux Toolkit with Entity Adapter
import { createAsyncThunk, createDraftSafeSelector, createEntityAdapter, createSlice } from '@reduxjs/toolkit';
import axios from 'axios';
const socialAccountsAdapter = createEntityAdapter({});
export const getSocialAccounts = createAsyncThunk('app/getSocialAccounts', async () => {
const response = await axios.get(`/SocialAccount/my-connected-accounts`);
// return []
return response.data.data;
});
@technoknol
technoknol / create-react-app SSL generate Windows.md
Last active May 1, 2021 11:29
create-react-app SSL generate Windows
  1. Install OpenSSL on your windows machine.

  2. Open Gitbash and Go to your project root folder.

  3. fire below commands

openssl req -x509 -newkey rsa:2048 -keyout keytmp.pem -out cert.pem -days 365 openssl rsa -in keytmp.pem -out key.pem

  1. Now change the start script in the package.json file to:
@technoknol
technoknol / cygwin-in-webstorm
Created January 23, 2021 06:53
Open Cygwin in Webstorm / PHPStorm
// paste this command in Shell Path field.
C:\cygwin64\bin\env.exe CHERE_INVOKING=1 /bin/bash -l
@technoknol
technoknol / cygwin.reg
Created January 23, 2021 06:39
Cygwin context menu in Windows Explorer.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\z_cygwin_bash]
@="Cygwin Here"
"Icon"="C:\\cygwin64\\Cygwin.ico"
[HKEY_CLASSES_ROOT\Directory\Background\shell\z_cygwin_bash\command]
@="C:\\cygwin64\\bin\\mintty.exe /bin/sh -lc 'cd \"`cygpath \"%V\"`\"; exec bash'"
[HKEY_CLASSES_ROOT\Directory\shell\z_cygwin_bash]
@technoknol
technoknol / site.conf
Created July 23, 2020 13:33
.NET core app with SignalR with SSL with Apache Reverse Proxy Configuration
<IfModule mod_ssl.c>
<VirtualHost *:443>
RewriteEngine On
ProxyPreserveHost On
ProxyRequests Off
# allow for upgrading to websockets
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://localhost:5000/$1 [P,L]