Skip to content

Instantly share code, notes, and snippets.

View mpfund's full-sized avatar

Marinus Pfund mpfund

  • ifempty
  • Munich
View GitHub Profile
@mpfund
mpfund / about.md
Created August 9, 2011 20:19 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@mpfund
mpfund / Example_costumEvents.html
Created September 1, 2011 17:17
A Costum-Event-Object with Async/sync firing
<!DOCTYPE html>
<html>
<head>
<title>Costume Sync/Async Events</title>
</head>
<body>
<script type="text/javascript" src="costumEvents.js"></script>
<script>
/* a wait function - loops until waittingtime is reached */
var wait = function(waittime){
@mpfund
mpfund / find_debug_throw.regex
Created March 28, 2012 08:55
finds "#if DEBUG throw ... #endif" - Blocks in VS
\#if:Wh+DEBUG[:Wh\n]+throw(.|\n)*\#endif
@mpfund
mpfund / resizeImageAntialiasing.cs
Created May 7, 2012 08:34
Resize Image with Antialiasing
Bitmap bmp = new Bitmap(width, height);
Graphics graph = Graphics.FromImage(bmp);
graph.InterpolationMode = InterpolationMode.High;
graph.CompositingQuality = CompositingQuality.HighQuality;
graph.SmoothingMode = SmoothingMode.AntiAlias;
graph.DrawImage(image, new Rectangle(0, 0, width, height));

sources

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'

sudo add-apt-repository ppa:webupd8team/sublime-text-2 

update

sudo apt-get update

packages

@mpfund
mpfund / gist:6288711
Created August 20, 2013 23:35
Walk Trees
public static class WalkTreeExtension
{
public static void DoWalk<T>(this IEnumerable<T> ienu, Action<T> a, Func<T,IEnumerable<T>> childs)
{
foreach(var e in ienu)
{
a(e);
DoWalk(childs(e), a, childs);
}
}
@mpfund
mpfund / connectToSQL.cs
Created September 9, 2013 13:17
Simple connection to SQL-Server (localDB)
class Program
{
static void Main(string[] args)
{
string connstr = "Data Source=(localDB)\\v11.0;Initial Catalog=inloox;Integrated Security=true";
SqlConnection conn = new SqlConnection(connstr);
try
{
conn.Open();
var comm = conn.CreateCommand();
@mpfund
mpfund / gist:7656361
Created November 26, 2013 10:38
Usercontrol: prints all system fonts
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
var props = typeof(System.Drawing.SystemFonts).GetProperties();
public static void RemoveDelegateFromEvent(object target, string EventPropertyName)
{
var bindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance |BindingFlags.Static;
var ev = target.GetType().GetEvent(EventPropertyName, bindingFlags);
var f1 = target.GetType().GetField(EventPropertyName, bindingFlags);
// search in base class
if (f1 == null)
f1 = target.GetType().BaseType.GetField(EventPropertyName, bindingFlags);
@mpfund
mpfund / oracle_exception_01652.txt
Created July 14, 2014 08:10
Oracle Exception 01652 "unable to extend temp segement" & fix
Oracle Exception:
{"ORA-01652: unable to extend temp segment by 2048 in tablespace TS_TEMP"}
Fix:
SELECT file_name, tablespace_name, ROUND(bytes/1024000) MB
FROM dba_data_files
ORDER BY 1;
alter tablespace ts_temp add TEMPFILE 'C:\app\inloox_oracle\product\12.1.0\dbhome_2\database\TEMP04.dbf' size 2000M autoextend on;