Skip to content

Instantly share code, notes, and snippets.

View mfpopa's full-sized avatar

Mihail-Florin Popa mfpopa

View GitHub Profile
@ajdruff
ajdruff / fix-git-line-endings
Last active February 29, 2024 13:02
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
@muhammadghazali
muhammadghazali / What is server_names_hash_bucket_size.md
Last active February 9, 2024 14:13
Nginx: What is server_names_hash_bucket_size?

Background

While I'm learning how to use Nginx, I was instructed to update the server_names_hash_bucket_size (/etc/nginx/nginx.conf) value from 32 to 64, but I don't understand why should I increase the value to 64.

References

References that have been read so far:

@asadrefai
asadrefai / LargeFileUpload.ps1
Last active December 19, 2022 17:53
Large file upload in SharePoint Online with CSOM PowerShell
Try{
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll'
Add-Type -Path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll'
}
catch {
Write-Host $_.Exception.Message
Write-Host "No further parts of the migration will be completed"
}
Function UploadFileInSlice ($ctx, $libraryName, $fileName, $fileChunkSizeInMB) {
@tracker1
tracker1 / 01-directory-structure.md
Last active May 4, 2024 19:55
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@vgrem
vgrem / SP.IsCurrentUserMemberOfGroup.Example.js
Last active April 29, 2021 17:11
Determine if current user is a member of Group via CSOM(JavaScript) in SharePoint 2010/2013
//Usage
function IsCurrentUserWithContributePerms()
{
IsCurrentUserMemberOfGroup("Members", function (isCurrentUserInGroup) {
if(isCurrentUserInGroup)
{
// The current user is in the [Members] group
}
});