Skip to content

Instantly share code, notes, and snippets.

View mrcaron's full-sized avatar
👾
Typing typing typing

Michael Caron mrcaron

👾
Typing typing typing
View GitHub Profile
@mrcaron
mrcaron / GridNode.fx
Created February 5, 2010 16:43
Creating a jfxtras Grid in JFX
/* Creating an org.jfxtras.scene.layout.Grid */
public class MyGrid extends CustomNode {
override function create(): Node {
Grid {
rows: [
Row{
cells: [Text {content: "Username:"}, TextBox {}]
},
Row{
@mrcaron
mrcaron / Powershell_Prompt.ps1
Created January 20, 2010 17:16
Powershell prompt
# Powershell Prompt
$global:CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent()
function prompt
{
$un = [Regex]::Match($CurrentUser.Name,"SOLIDWORKS\\+(.*)").Groups[1].Value
$hn = [Net.DNS]::GetHostName()
$host.ui.rawui.WindowTitle = $un + "@" + $hn #+ " Line: " + $host.UI.RawUI.CursorPosition.Y
Write-Host($un + "@" + $hn + " ") -foregroundcolor Green -nonewline; Write-Host ($(get-location)) -foregroundcolor Yellow
Write-Host(">") -nonewline -foregroundcolor Green
@mrcaron
mrcaron / ghpushexisiting.sh
Created October 22, 2009 20:16
Git Push Existing script
#!/bin/bash
# use this script at the root directory of your local repo
# Input repo name and username
git remote add origin git@github.com:${2}/${1}.git
git push origin master
@mrcaron
mrcaron / gitprojinit.sh
Created October 22, 2009 20:12
Git project init script
#!/bin/bash
# input repository name, using '-' for any spaces ($1)
# input GH username $2
mkdir ${1}
cd ${1}
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@github.com:${2}/${1}.git
@mrcaron
mrcaron / setControls.cpp
Created September 17, 2009 17:20
Sets up unicode font in a rich text edit control for MFC
/* SET UNICODE FONT */
CDC *pDC = GetDC();
LOGFONT lf;
memset(&lf, 0, sizeof(lf));
lf.lfHeight = MulDiv(20, ::GetDeviceCaps(pDC->m_hDC, LOGPIXELSY), 72);
lf.lfWeight = FW_NORMAL;
lf.lfOutPrecision = OUT_TT_ONLY_PRECIS;
wcscpy(lf.lfFaceName, _T("Lucida Sans Unicode"));
CFont font;
font.CreateFontIndirect(&lf);