Skip to content

Instantly share code, notes, and snippets.

@GAS85
GAS85 / apache2_pihole.md
Last active May 24, 2024 18:57
Apache2 config for pihole with custom / non-admin link
@nommuna2
nommuna2 / Sample.js
Last active May 24, 2024 18:44
(ArcGIS API for JavaScript) Sample of using chart.js with the Esri 4.7 API
//Please go to the following jsbin for a working sample: https://jsbin.com/nejolahicu/1/edit?html,js,output
//Depending on server load, it may take awhile for the feature layer to load and be displayed on the map.
require([
"esri/Map",
"esri/views/MapView",
"esri/PopupTemplate",
"esri/layers/FeatureLayer",
"esri/widgets/Popup",
"esri/tasks/support/Query",
"https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.js",
@ttimasdf
ttimasdf / fix_virtualenv
Last active May 24, 2024 18:30 — forked from tevino/fix_virtualenv
Fix python virtualenv after python update, forked version for choice of python executable
#!/usr/bin/env bash
ENV_PATH="$(dirname "$(dirname "$(which pip)")")"
SYSTEM_VIRTUALENV="$(which -a virtualenv|tail -1)"
echo "Ensure the root of current virtualenv:"
echo " $ENV_PATH"
read -p "‼️ Say no if you are not sure (y/N) " -n 1 -r
echo
PYEXC_DEF="$(sed -n '1s/^#!//p' $SYSTEM_VIRTUALENV)"
read -p "🐍 Choose which python to use? [$PYEXC_DEF] " PYEXC
@eduardojesus12
eduardojesus12 / Ejercicio4.java
Last active May 24, 2024 18:22
Trabajar con código de otros 4
package com.generation;
public class Codigo4 {
Scanner s = new Scanner();
System.out.print("Turno del jugador 1 (introduzca piedra, papel o tijeras): ");
String j1 = s.nextLine();
System.out.print("Turno del jugador 1 (introduzca piedra, papel o tijeras): ");
@artemonsh
artemonsh / tokens.md
Created April 6, 2023 18:10 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
// http://www.iquilezles.org/www/articles/palettes/palettes.htm
// As t runs from 0 to 1 (our normalized palette index or domain),
//the cosine oscilates c times with a phase of d.
//The result is scaled and biased by a and b to meet the desired constrast and brightness.
vec3 cosPalette( float t, vec3 a, vec3 b, vec3 c, vec3 d )
{
return a + b*cos( 6.28318*(c*t+d) );
}
float sphere(vec3 pos, float rad){
@pablotolentino
pablotolentino / Visual Studio 2022 Product Key
Created November 20, 2021 20:41
Visual Studio 2022 Enterprise Product key
Visual Studio 2022
Enterprise :
VHF9H-NXBBB-638P6-6JHCY-88JWH
Professional:
TD244-P4NB7-YQ6XK-Y8MMM-YWV2J
@ricardodantas
ricardodantas / validacao+mascara.js
Last active May 24, 2024 17:52
Máscara e validação de RG, CNPJ, CPF, etc...
// JavaScript Document
// adiciona mascara para rg
// Cada estado têm regras e quantidades diferentes de números no registro. Por isso,
// não há uma maneira confiável de fazer a validação do mesmo.
function MascaraRg(v0,errChar='?'){
const v = v0.toUpperCase().replace(/[^\dX]/g,'');
return (v.length==8 || v.length==9)?
v.replace(/^(\d{1,2})(\d{3})(\d{3})([\dX])$/,'$1.$2.$3-$4'):
(errChar+v0)
@fdemmer
fdemmer / artnet.py
Created November 29, 2013 12:29
send an art-net udp packet (ArtDMX)
#!/usr/bin/env python
import socket
import struct
class ArtNet(object):
PORT = 6454 # 0x1936
def __init__(self, port=PORT):
self._socket = None