Skip to content

Instantly share code, notes, and snippets.

View wieslawsoltes's full-sized avatar

Wiesław Šoltés wieslawsoltes

View GitHub Profile
using System;
using System.Collections.Specialized;
using System.ComponentModel;
namespace ThomasJaworski.ComponentModel
{
public abstract class ChangeListener : INotifyPropertyChanged, IDisposable
{
#region *** Members ***
protected string _propertyName;
@dedico
dedico / Program.cs
Created January 5, 2012 23:06
iTextSharp and unicode characters
using System;
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;
namespace RussianPDFtest
{
class Program
{
@praeclarum
praeclarum / SimplifiedPolyline.cs
Created November 27, 2012 21:04
A simplified polyline that has only enough line segments to accurately represent the original polyline.
//
// Copyright 2012 Frank A. Krueger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
@panzi
panzi / mandelbrot.c
Created November 10, 2013 04:40
gcc -lm -Wall -Werror -Wextra -pedantic -std=c99 -O3 -o mandelbrot mandelbrot.c original: http://preshing.com/20110926/high-resolution-mandelbrot-in-obfuscated-python/
#include <stdio.h>
#include <complex.h>
#define dc double complex
dc
Y(dc
V,
dc B,dc c){
return
(cabs (V)<6)?(c?Y(V *V+
B,B,c-1):c):(2+c-4*cpow
@justecorruptio
justecorruptio / 2048.c
Created April 4, 2014 03:49
Tiny 2048 in C!
M[16],X=16,W,k;main(){T(system("stty cbreak")
);puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i
,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M
[w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<<
(l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k)
]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d
-1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X]
*i;i--);i?M[i%X]=2<<rand()%2:0;for(W=i=0;i<4;
)s(0,i++);for(i=X,puts("\e[2J\e[H");i--;i%4||
puts(""))printf(M[i]?"%4d|":" |",M[i]);W-2
@staltz
staltz / introrx.md
Last active July 25, 2024 08:00
The introduction to Reactive Programming you've been missing
@FeodorFitsner
FeodorFitsner / build.cmd
Created July 5, 2015 20:33
Taking version from AssemblyInfo.cs and using it with AppVeyor
rem This is how we get version in environment variable
for /f %%i in ('PowerShell -File get-version.ps1') do set my_version=%%i
module type CELL = sig
type 'a cell
type 'a exp
val return : 'a -> 'a exp
val (>>=) : 'a exp -> ('a -> 'b exp) -> 'b exp
val cell : 'a exp -> 'a cell exp
val get : 'a cell -> 'a exp
@FeodorFitsner
FeodorFitsner / update-global-assemblyinfo.ps1
Created January 6, 2016 23:04
Update global assemblyinfo with build number
$assemblyFile = "$env:APPVEYOR_BUILD_FOLDER\src\GlobalAssemblyInfo.cs"
$regex = new-object System.Text.RegularExpressions.Regex ('(AssemblyInformationalVersion(Attribute)?\s*\(\s*\")(.*)(\"\s*\))',
[System.Text.RegularExpressions.RegexOptions]::MultiLine)
$content = [IO.File]::ReadAllText($assemblyFile)
$version = $null
$match = $regex.Match($content)
if($match.Success) {
@alirobe
alirobe / reclaimWindows10.ps1
Last active July 3, 2024 09:36
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###