Skip to content

Instantly share code, notes, and snippets.

View Gambitier's full-sized avatar
🏆
Open for collaboration

Akash Jadhav Gambitier

🏆
Open for collaboration
View GitHub Profile
@Gambitier
Gambitier / .golangci.yml
Created August 5, 2024 14:28 — forked from maratori/.golangci.yml
Golden config for golangci-lint
# This code is licensed under the terms of the MIT license https://opensource.org/license/mit
# Copyright (c) 2021 Marat Reymers
## Golden config for golangci-lint v1.59.1
#
# This is the best config for golangci-lint based on my experience and opinion.
# It is very strict, but not extremely strict.
# Feel free to adapt and change it for your needs.
run:
@Gambitier
Gambitier / github-release-notes.md
Created October 24, 2023 16:41
Creating Github Release Notes
using ClosedXML.Excel;
public async Task<FileResult> ExportPeopleInExcel()
{
var people = await context.People.ToListAsync();
var fileName = "people.xlsx";
return GenerateExcel(fileName, people);
}
private FileResult GenerateExcel(string fileName, IEnumerable<Person> people)
import { exec as exec_child_process } from 'child_process';
const exec = util.promisify(exec_child_process);
async function initGitRepo(dest: string) {
try {
const command = 'git init';
const { stdout, stderr } = await exec(command, {
cwd: dest
});
console.log(`stdout: ${stdout}`);
import * as convert from 'xml-js';
const xml = readFileSync(filePath, {
encoding: 'utf8'
});
const result1 = convert.xml2json(xml, { compact: true, spaces: 4 });
const data = JSON.parse(result1) as DataType;
function getAllFiles(dirFullPath: string, arrayOfFiles: string[] = []) {
const files = readdirSync(dirFullPath);
arrayOfFiles = arrayOfFiles || [];
files.forEach(function (file) {
if (statSync(dirFullPath + '/' + file).isDirectory()) {
arrayOfFiles = getAllFiles(dirFullPath + '/' + file, arrayOfFiles);
} else {
arrayOfFiles.push(path.join(dirFullPath, '/', file));
@Gambitier
Gambitier / deepGroupBy.js
Created January 6, 2023 06:11 — forked from leofavre/deepGroupBy.js
Similar to LoDash groupBy(), but with nested groups.
/**
* Part of [Canivete](http://canivete.leofavre.com/#deepgroupby)
*
* Groups the contents of an array by one or more iteratees.
* Unlike Lodash [`groupBy()`](https://lodash.com/docs/4.17.4#groupBy),
* this function can create nested groups, but cannot receive
* strings for iteratees.
*/
const deepGroupBy = (collection, ...iteratees) => {
let paths = collection.map(value => iteratees.map(iteratee => iteratee(value))),

Paste the code in your Browser’s Console

var jqry = document.createElement('script');
jqry.src = "https://code.jquery.com/jquery-3.3.1.min.js";
document.getElementsByTagName('head')[0].appendChild(jqry);
jQuery.noConflict();
@Gambitier
Gambitier / github_clone_using_token.sh
Created December 1, 2022 13:39 — forked from magickatt/github_clone_using_token.sh
Clone a GitHub repository using a Personal Access Token
export GITHUB_USER=magickatt
export GITHUB_TOKEN=secret
export GITHUB_REPOSITORY=magickatt/ContainerisingLegacyApplicationsTalk
git clone https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
public class MyApplicationDataContext : DbContext
{
public override int SaveChanges(bool acceptAllChangesOnSuccess)
{
OnBeforeSaving();
return base.SaveChanges(acceptAllChangesOnSuccess);
}
public override async Task<int> SaveChangesAsync(
bool acceptAllChangesOnSuccess,