Skip to content

Instantly share code, notes, and snippets.

View Sebfh's full-sized avatar

Sebastiaan Hoejenbos Sebfh

View GitHub Profile
@Sebfh
Sebfh / gist:2006275
Created March 9, 2012 12:14
SQL: Cursor
declare @message nvarchar(250)
DECLARE #cursor_name# CURSOR FOR
#select_statement#
OPEN #cursor_name#;
FETCH NEXT FROM #cursor_name#
INTO @#variable#;
WHILE @@FETCH_STATUS = 0
BEGIN
@Sebfh
Sebfh / rvm2rbenv.txt
Created June 6, 2012 20:27 — forked from brentertz/rvm2rbenv.txt
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@Sebfh
Sebfh / gist:4585872
Last active September 26, 2018 20:14
javascript number to currency á la rails
function number_to_currency(number, options) {
try {
var options = options || {};
var precision = options["precision"] || 2;
var unit = options["unit"] || "\u20AC";
var separator = precision > 0 ? options["separator"] || "." : "";
var delimiter = options["delimiter"] || ",";
var parts = parseFloat(number).toFixed(precision).split('.');
return unit + number_with_delimiter(parts[0], delimiter) + separator + parts[1].toString();
@Sebfh
Sebfh / find_storedprocedure
Last active December 11, 2015 22:49
TSQL: Find stored procedures that contain a string of text
SELECT B.Name, *
FROM syscomments A INNER JOIN sysobjects B
ON A.id = B.id
WHERE A.text like '%yourtext%'

Debugging in Umbraco

Debugging in Umbraco is a hell...

Web.config

<add key="umbracoDebugMode" value="true" /> in web.config

Query string

?umbDebugShowTrace=true to url of the page

@Sebfh
Sebfh / simplewebserver
Last active June 19, 2019 08:02
simple webserver on OSX
$ cd intofolder
$ python -m SimpleHTTPServer
@Sebfh
Sebfh / gist:a71b47ad4fb20b01165e
Created October 29, 2014 10:57
UI-Router problem
$urlRouterProvider.when('/admin', '/admin/dashboard');
$stateProvider
.state('root', {
abstract: true,
url: '',
views: {
'main-layout': {
templateUrl: '/views/layouts/main.html'
}