Skip to content

Instantly share code, notes, and snippets.

View thlorenz's full-sized avatar
👁️
{ this.props.status }

Thorsten Lorenz thlorenz

👁️
{ this.props.status }
View GitHub Profile
@thlorenz
thlorenz / git_svn_ps_prompt.ps1
Created August 15, 2010 14:53
Svn/Git PowerShell prompt
# See http://gist.github.com/180853 for gitutils.ps1.
. (Resolve-Path ~/Documents/WindowsPowershell/gitutils.ps1)
function prompt {
writeUserLocation
if (isCurrentDirectoryGitRepository) {
writeGitInfo
}
@thlorenz
thlorenz / Cascading Styles WPF
Created October 23, 2010 00:54
Shows a way to inherit styles and add to it in WPF
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<Grid.Resources>
<Style BasedOn="{StaticResource {x:Type Button}}" TargetType="{x:Type Button}">
<Setter Property="Background" Value="Blue"/>
</Style>
</Grid.Resources>
<Border
HorizontalAlignment="Center"
VerticalAlignment="Center"
@thlorenz
thlorenz / handlebarify.js
Last active December 10, 2015 15:28
A browserify plugin that precompiles handlebars templates .
function handlebarify(bundle) {
var precompile = require('handlebars').precompile;
function handlebarsPlugin(body, file) {
return 'var Handlebars = require(\'handlebars\');\nmodule.exports = ' + precompile(body) + ';';
}
// browserify doesn't allow passing an array of extensions, so we register each separately
bundle.register('.handlebars', handlebarsPlugin);
bundle.register('.hbs', handlebarsPlugin);
}
@thlorenz
thlorenz / api.md
Last active December 14, 2015 14:48
Trying to nail down browser pack input format to support source mapping urls

We'll have an array of files to be included in the bundle as shown in this example.

Except we'll add source map info, so browser-pack can inline this into the bundle.

Current file format

{
    "id": "a1b5af78",
 "source": "console.log(require('./foo')(5))",
@thlorenz
thlorenz / ReadmeCopy.md
Last active December 17, 2015 12:29
Copy valupack's goals. valuepack is a community driven rating system for nodejs modules on npm in order to help in selecting the right one.

Copy of these goals in order to facilitate discussions.

valuepack goals

Community driven rating system for nodejs modules on npm in order to help in selecting the right one.

Why

Whith 50k+ modules on npm finding the right module for the problem you have is becoming more tedious than it needs to be. Especially newcomers to nodejs are overwhelmed with the amount of modules to choose from.

@thlorenz
thlorenz / valuepack.proposal.md
Last active December 18, 2015 08:59
Details outlining the talk about valuepack

What is the talk about?

valuepack a tool that will help the developers select the right npm module for the job. It is a community driven package rating tool, read more about it's goals.

Approximate Talk Time: 20-30 min

What is valuepack?

valuepack will consist of:

@thlorenz
thlorenz / index.js
Created July 8, 2013 02:05
made with requirebin.com
var term = require('hypernal')();
term.appendTo(document.body);
var difflet = require('difflet')({
indent : 2
, comma : 'first'
, comment: true
});
@thlorenz
thlorenz / index.js
Last active December 19, 2015 11:09
made with requirebin.com
var term = require('hypernal')();
term.appendTo(document.body);
var difflet = require('difflet')({
indent : 4
, comma : 'first'
, comment: true
});
@thlorenz
thlorenz / Readme.md
Last active December 19, 2015 16:59
Tabular vs. White Space removed

Trying to get people's opinions on what they consider more readable, not focusing on comma first or not, but on the fact that the original is tabular and the beautified one removed the whitespace and therefore is not.

Please vote +1 for either original or beautified.