Skip to content

Instantly share code, notes, and snippets.

@brihernandez
brihernandez / SmoothDamp.cs
Last active January 10, 2024 08:05
Framerate independent damping
using UnityEngine;
// Thanks to Rory Driscoll
// http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/
public static class SmoothDamp
{
/// <summary>
/// Creates dampened motion between a and b that is framerate independent.
/// </summary>
/// <param name="from">Initial parameter</param>
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active November 5, 2024 12:03
Online Resources For Web Developers (No Downloading)
@L0N3W0LF
L0N3W0LF / option-and-result.cpp
Last active May 6, 2023 14:04
Rust's Option type and Result type in C++ using tagged unions
//clang 3.8.0
#include <iostream>
// Option type and Result type implementations (tagged unions).
enum class OptionType { Some, None };
template<typename T>
struct Option
@paladini
paladini / aws-ec2-redis-cli.md
Last active October 24, 2024 16:44 — forked from todgru/aws-ec2-redis-cli.md
AWS redis-cli without redis server on AWS EC2

Setup redis-cli without the whole Redis Server on AWS EC2

This fast tutorial will teach you how to install redis-clion AWS EC2 without having to install the whole Redis Server. Firstly, SSH into your EC2 instance and run the following command:

$ sudo yum install gcc

This may return an "already installed" message, but that's OK. After that, just run:

$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make && sudo cp src/redis-cli /usr/local/bin/ && sudo chmod 755 /usr/local/bin/redis-cli

NES emulator development guide

Overview of document

@bgromov
bgromov / git-reset-author.sh
Created June 23, 2016 17:50
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@dvrensk
dvrensk / redsys_result_codes.rb
Created February 4, 2015 17:02
These are the result codes from Spanish payment gateway Redsys (formerly Sermepa) that I've managed to collect. The list is no doubt incomplete, and I'll be happy to update it if you have any more codes.
RESULT_CODES = (<<-EOT).split(/\r?\n/).reject {|s| s.match(/^( *#.*)?$/)}.map { |s| s.sub(/^ +/,'').split(/ +/,2) }.to_h
# Copied from http://dwalins.com/2014/codigo-de-respuesta-de-sermepa-redsys/
0101 Tarjeta Caducada
0102 Tarjeta en excepción transitoria o bajo sospecha de fraude
0104 Operación no permitida para esa tarjeta o terminal
0106 Intentos de PIN excedidos
0116 Disponible Insuficiente
0118 Tarjeta no Registrada
0125 Tarjeta no efectiva
0129 Código de seguridad (CVV2/CVC2) incorrecto
@johnkary
johnkary / app_dev.php
Created January 4, 2015 21:51
Allow setting breakpoints in Symfony component code when step debugging with Xdebug. Disables cached/compiled files when step debugging. Thanks Joshua Thijssen <https://www.adayinthelifeof.nl/2014/12/31/debugging-symfony-components/> and Antonio J. García Lagar <http://aj.garcialagar.es/blog/debugging-symfony-with-xdebug-2/> for the inspiration.
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
// If you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
// This check prevents access to debug front controllers that are deployed by accident to production servers.
@todgru
todgru / aws-ec2-redis-cli.md
Created June 12, 2014 23:01
AWS redis-cli on EC2
#!/bin/sh
#
# Adam Sharp
# Aug 21, 2013
#
# Usage: Add it to your PATH and `git remove-submodule path/to/submodule`.
#
# Does the inverse of `git submodule add`:
# 1) `deinit` the submodule
# 2) Remove the submodule from the index and working directory