Skip to content

Instantly share code, notes, and snippets.

View jean-lourenco's full-sized avatar
📦
resolving binding redirects

Jean Lourenço jean-lourenco

📦
resolving binding redirects
View GitHub Profile
@superic
superic / BlackAndWhite.cs
Created December 28, 2013 23:37
Make an image black and white in c#. For more information: http://eric.tumblr.com/post/71459461047/make-an-image-black-and-white-in-c
private static Bitmap BlackAndWhite(Bitmap image, Rectangle rectangle)
{
Bitmap blackAndWhite = new System.Drawing.Bitmap(image.Width, image.Height);
// make an exact copy of the bitmap provided
using(Graphics graphics = System.Drawing.Graphics.FromImage(blackAndWhite))
graphics.DrawImage(image, new System.Drawing.Rectangle(0, 0, image.Width, image.Height),
new Rectangle(0, 0, image.Width, image.Height), GraphicsUnit.Pixel);
// for every pixel in the rectangle region
@fieg
fieg / redis-expire.sh
Last active October 10, 2022 23:09
Set expire on large set of keys using pattern in Redis
#!/bin/bash
if [ $# -ne 4 ]
then
echo "Usage: $0 <host> <port> <pattern> <seconds>"
exit 1
fi
cursor=-1
keys=""
@davidfowl
davidfowl / Example1.cs
Last active June 19, 2024 16:41
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@rylev
rylev / rust-in-large-organizations-notes.md
Last active February 2, 2023 10:08
Rust in Large Organizations Notes

Rust in Large Organizations

Initially taken by Niko Matsakis and lightly edited by Ryan Levick

Agenda

  • Introductions
  • Cargo inside large build systems
  • FFI
  • Foundations and financial support