Skip to content

Instantly share code, notes, and snippets.

View schittli's full-sized avatar

Tom-- schittli

  • Biel / Bienne, Switzerland
  • 14:05 (UTC +02:00)
View GitHub Profile
@oliverheilig
oliverheilig / CSharpGeoSnippets.md
Last active September 12, 2018 10:16
C# geo snippets

This is my list of code snippets useful when writing (geo)graphical applications in C#. Of course there are many powerful .NET libraries which handle these problems. But sometimes it is easier to just include some lines of code.

I've written the code to run directly in the browser using JSIL. You can extract the essential lines in your project. It should work for .NET, Mono, Silverlight, WinRT and Windows Phone. I've included the base types needed (Point, Rect) into the snippet. You can replace them with the appropriate type of the framework you are using.

For example: If you use the line simplification for WPF lines, you can take the System.Windows.Point. If you use it for WCF Spatial Library, you can take the [System.Spatial.GeometryPoint](http://msdn.microsoft.co

@robertvesco
robertvesco / remap_print_screen.ahk
Created December 9, 2013 23:40
Autohotkey utilities
;http://www.syringe.net.nz/2013/06/12/SoYoursquoveGotANewLenovoAndYouHateTheLsquoislandKeyboardrsquo.aspx
; Remap PrintScreen to be the right hand context menu key
#PrintScreen::PrintScreen ;Print SCreen now requires Windows Modifier
PrintScreen::AppsKey
;Remap End and Insert. Switch them around
Insert::End
End::Insert
@ziqbalbh
ziqbalbh / csv-split-trim.ps1
Created December 14, 2013 08:04
three different ways of splitting a comma separated string and trimming the items using PowerShell
$CSVData = @("One , Two , Three ")
#just split
$Data = $CSVData -split (",")
#first way of split and trim
$Data = $CSVData -split ',' | foreach {$_.Trim()}
#second way of split and trim
$CSVData.Split(",").Trim()
@Jaykul
Jaykul / Ribbon.psd1
Created January 30, 2014 08:20
Ribbon Window in PowerShell (#requires ShowUI)
## AutoGenerated file. Do Not Edit. Regenerate by running
## Add-UIModule -AssemblyName System.Windows.Controls.Ribbon -Name Ribbon
@{
ModuleVersion = '1.0'
RequiredModules = 'ShowUI'
RequiredAssemblies = 'System.Xaml','System.Windows.Controls.Ribbon'
ModuleToProcess = 'Ribbon.psm1'
GUID = 'b307ebad-cfb1-4c34-895c-471792c513db'
FunctionsToExport = @('New-KeyTipControl','New-RibbonContextualTabGroupsPanel','New-RibbonGalleryCategoriesPanel','New-RibbonGalleryItemsPanel','New-RibbonGroupItemsPanel','New-RibbonGroupsPanel','New-RibbonMenuItemsPanel','New-RibbonQuickAccessToolBarOverflowPanel','New-RibbonQuickAccessToolBarPanel','New-RibbonTabHeadersPanel','New-RibbonTabsPanel','New-RibbonTitlePanel','New-StarLayoutInfo','New-Ribbon','New-RibbonMenuButton','New-RibbonApplicationMenu','New-RibbonMenuItem','New-RibbonApplicationMenuItem','New-RibbonSplitMenuItem','New-RibbonApplicationSplitMenuItem','New-RibbonButton','New-RibbonCheckBox','New-RibbonComboBox','New-RibbonContextMenu','New-Ri
@janikvonrotz
janikvonrotz / Create-AlphabeticalSortedListOfAllFunctions.ps1
Created April 17, 2014 08:43
PowerShell: Create alphabetical sorted list of all functions #PowerShell #PowerUp
cls
$B = "https://github.com/janikvonrotz/PowerShell-PowerUp/blob/master/functions/"
$A = "H:/SkyDrive/Shared/Projects/GitHub/Powershell-PowerUp/functions/"
$Terms = Get-ChildItem $PSfunctions.Path -Recurse -Filter *.ps1 |
select Name, BaseName, @{L="Verb";E={$_.Name.Split("-")[0]}},@{L="Noun";E={$_.BaseName.Split("-")[1]}}, FullName, @{L="Url";E={$_.FullName -replace "\\","/" -replace $A,$B}} |
Sort-Object Noun, Verb
@jberezanski
jberezanski / bla.cs
Last active February 2, 2019 00:25
PS exe output and error redirection
namespace Test
{
using System;
using System.Linq;
class Program
{
public static void Main(string[] args)
{
// pipe buffers seem to be around 4100 bytes on my system
@tessi
tessi / installation.md
Last active April 27, 2025 11:43
Install OpenProject on uberspace.de

How to install OpenProject on uberspace.de

Follow those steps to install OpenProject on a fresh uberspace.

Step 1: Install dependencies

First we set-up all dependencies. We use ruby 2.1.2 and install gems in a user directory:

echo "gem: --user-install --no-rdoc --no-ri" > ~/.gemrc

cat <<'EOF' >> ~/.bash_profile

@goyuix
goyuix / Modify-DefaultHive.ps1
Created July 30, 2014 02:57
PowerShell to mount default NTUSER.DAT, modify it and unload it
Write-Host "Attempting to mount default registry hive"
& REG LOAD HKLM\DEFAULT C:\Users\Default\NTUSER.DAT
Push-Location 'HKLM:\DEFAULT\Software\Microsoft\Internet Explorer'
if (!(Test-Path Main)) {
Write-Warning "Adding missing default keys for IE"
New-Item Main
}
$sp = Get-ItemProperty -Path .\Main
Write-Host "Replacing $_ : $($sp.'Start Page')"
@omidkrad
omidkrad / ExecJavaScript.ps1
Last active April 10, 2023 18:12
PowerShell function to run JavaScript/JQuery and return results back to PS, with timeout
# PowerShell function to run JavaScript/JQuery and return results back to PS, with timeout
# some web page with jQuery in it
$url = "http://jquery.com/"
Function ResetTimer
{
$script:startTime = [DateTime]::Now
}
@tylerneylon
tylerneylon / json.lua
Last active August 30, 2025 14:12
Pure Lua json library.
--[[ json.lua
A compact pure-Lua JSON library.
The main functions are: json.stringify, json.parse.
## json.stringify:
This expects the following to be true of any tables being encoded:
* They only have string or number keys. Number keys must be represented as
strings in json; this is part of the json spec.