Skip to content

Instantly share code, notes, and snippets.

@alfeugds
alfeugds / CurrencyConverter.cs
Last active July 13, 2023 06:01
Xamarin Forms Currency Mask for Entry fields
using System;
using System.Globalization;
using System.Text.RegularExpressions;
using Xamarin.Forms;
namespace MyProject.Util
{
/// <summary>
/// Converter for using in Entry fields for masked input of currency.
/// <para>The binded property must be of type decimal, and must invoke the PropertyChangedEventArgs event whenever the value is changed, so that the desired mask behavior is kept.</para>
@paragonie-scott
paragonie-scott / crypto-wrong-answers.md
Last active April 21, 2024 23:48
An Open Letter to Developers Everywhere (About Cryptography)
@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active April 25, 2024 12:16
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@elliottb
elliottb / fabfile.py
Created December 2, 2013 02:26
Example Python Fabric deployment script. Deploys code from a deployment box to a remote host. Usage from command line on the deployment box: fab deploy.
from fabric.api import local, run, env, put
import os, time
# remote ssh credentials
env.hosts = ['10.1.1.25']
env.user = 'deploy'
env.password = 'XXXXXXXX' #ssh password for user
# or, specify path to server public key here:
# env.key_filename = ''
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@konklone
konklone / ssl.rules
Last active August 8, 2023 08:39
nginx TLS / SSL configuration options for konklone.com
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@chadedrupt
chadedrupt / bootstrap.knockout.validation.js
Last active February 27, 2016 17:13
Use Bootstrap's error stying with knockout validation
ko.validation.configure({
insertMessages: true,
decorateElement: true,
errorElementClass: 'error',
errorMessageClass: 'help-inline'
});