Skip to content

Instantly share code, notes, and snippets.

@addyosmani
addyosmani / package.json
Last active May 21, 2024 19:56
npm run-scripts boilerplate
{
"name": "my-app",
"version": "1.0.0",
"description": "My test app",
"main": "src/js/index.js",
"scripts": {
"jshint:dist": "jshint src/js/*.js",
"jshint": "npm run jshint:dist",
"jscs": "jscs src/*.js",
"browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js",
@Strus
Strus / clangd.md
Last active May 21, 2024 19:56
How to use clangd C/C++ LSP in any project

How to use clangd C/C++ LSP in any project

tl;dr: If you want to just know the method, skip to How to section

Clangd is a state-of-the-art C/C++ LSP that can be used in every popular text editors like Neovim, Emacs or VS Code. Even CLion uses clangd under the hood. Unfortunately, clangd requires compile_commands.json to work, and the only way to painlessly generate it is to use CMake.

But what if I tell you you can quickly hack your way around that, and generate compile_commands.json for any project, no matter how compilcated? I have used that way at work for years, originaly because I used CLion which supported only CMake projects - but now I use that method succesfully with clangd and Neovim.

Method summary

Basically what we need to achieve is to create a CMake file that will generate a compile_commands.json file with information about:

@GustavoMartinx
GustavoMartinx / Redes.md
Last active May 21, 2024 19:54
Centralização dos conhecimentos mais relevantes de Redes de Computadores de forma resumida e bem explicada.

1 - Introdução

Caracteriza-se uma rede como um conjunto de sistemas de processamento de informação interligados através de um sistema de comunicação que permite a troca de informações entre eles.

Conceitos Básicos

Os sistemas de processamento de informações finais (equipamentos de terminal de dados ETD) conectam-se à sub-rede de comunicação na qual permite que os ETD da comuniquem-se entre si de forma ordenada. Para tal, um conjunto de regras devem ser obedecidas: os protocolos.

E esses são os três elementos estruturais básicos de uma rede:

Sub-rede de comunicação

  • composta pelos nós de rede que são interconectados por enlaces de comunicação.
@jakub-g
jakub-g / async-defer-module.md
Last active May 21, 2024 19:54
async scripts, defer scripts, module scripts: explainer, comparison, and gotchas

<script> async, defer, async defer, module, nomodule, src, inline - the cheat sheet

With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.

This document is a comparison of various ways the <script> tags in HTML are processed depending on the attributes set.

If you ever wondered when to use inline <script async type="module"> and when <script nomodule defer src="...">, you're in the good place!

Note that this article is about <script>s inserted in the HTML; the behavior of <script>s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)

size_t memcount_avx2(const void *s, int c, size_t n) {
__m256i cv = _mm256_set1_epi8(c), zv = _mm256_setzero_si256(), sum = zv, acr0,acr1,acr2,acr3;
const char *p,*pe;
for(p = s; p != (char *)s+(n- (n % (252*32)));) {
for(acr0 = acr1 = acr2 = acr3 = zv,pe = p+252*32; p != pe; p += 128) {
acr0 = _mm256_add_epi8(acr0, _mm256_cmpeq_epi8(cv, _mm256_lddqu_si256((const __m256i *)p)));
acr1 = _mm256_add_epi8(acr1, _mm256_cmpeq_epi8(cv, _mm256_lddqu_si256((const __m256i *)(p+32))));
acr2 = _mm256_add_epi8(acr2, _mm256_cmpeq_epi8(cv, _mm256_lddqu_si256((const __m256i *)(p+64))));
acr3 = _mm256_add_epi8(acr3, _mm256_cmpeq_epi8(cv, _mm256_lddqu_si256((const __m256i *)(p+96)))); __builtin_prefetch(p+1024);
}
@ammuench
ammuench / 8BitDoUltimateWifi_Linux.MD
Last active May 21, 2024 19:53
8BitDo Ultimate 2.4GHz wifi working in linux
@santaklouse
santaklouse / CrossOver.sh
Last active May 21, 2024 19:53
unlimited CrossOver trial (MacOS)
#!/usr/bin/env bash
# checck if pidof exists
PIDOF="$(which pidof)"
# and if not - install it
(test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof
# find app in default paths
CO_PWD=~/Applications/CrossOver.app/Contents/MacOS
test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS
@devomman
devomman / office-activation.md
Created May 30, 2023 11:01
Office Activation Command by Omman

Office 2021

Method 1: Using my command line

Step 1.1: Open cmd program with administrator rights.

  • First, you need to open cmd in the admin mode, then run all commands below one by one.

Step 1.2: Get into the Office directory in cmd.

  • For x86 and x64
cd /d %ProgramFiles(x86)%\Microsoft Office\Office16
cd /d %ProgramFiles%\Microsoft Office\Office16
@Refsa
Refsa / BlurEffect.compute
Last active May 21, 2024 19:49
Unity URP custom render feature for UI Blur
#pragma kernel Downscale
#pragma kernel GaussianBlurVertical
#pragma kernel GaussianBlurHorizontal
#pragma kernel BoxBlur
Texture2D<float4> _Source;
RWTexture2D<float4> _Dest;
float _Amount;
float2 _Size;
@asefsoft
asefsoft / list_of_blocked_sites.md
Last active May 21, 2024 19:47
لیست سایت های تحریم کننده ایران

لیست سایت ها و دامنه هایی که آی پی های ایران را تحریم کرده اند.

analytics.google.com
firebaseremoteconfig.googleapis.com
cloud.google.com
ads.google.com
fonts.googleapis.com
developer.android.com