Skip to content

Instantly share code, notes, and snippets.


Bernhard Döbler bardware

View GitHub Profile
View filesize_helper.js
Ember.Handlebars.helper('filesize', function(value) {
if (typeof value === 'undefined') {
return null;
var i,
units = ['B', 'KB', 'MB', 'GB', 'TB'];
for (i = 0; i < units.length; i++) {
if (value < 1024) {
filesize = Math.floor(value) + units[i];
bardware / SortableBindingList.vb
Created Mar 18, 2016 — forked from wcabus/SortableBindingList.vb
SortableBindingList is a list that supports sorting its items and filtering them.
View SortableBindingList.vb
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Reflection
Imports System.Linq
Imports System.Linq.Dynamic
''' <summary>
''' SortableBindingList is a list that supports sorting its items and filtering them.
''' When binding a <see cref="System.Collections.Generic.List(Of T)"/> to a <see cref="System.Windows.Forms.DataGridView"/>, you can not sort by clicking on the columns
''' or filter the list. With this list, you can.
bardware / .eslintrc
Created Jun 4, 2016 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
View .eslintrc
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
bardware / stacktrace.log
Created Jun 24, 2016
An internal error occurred during: "Requesting JavaScript AST from selection".
View stacktrace.log
java.lang.ClassCastException: org.eclipse.wst.jsdt.internal.core.dom.binding.FunctionBinding cannot be cast to org.eclipse.wst.jsdt.core.dom.IVariableBinding
at org.eclipse.wst.jsdt.core.dom.BindingResolverDom.resolveVariable(
at org.eclipse.wst.jsdt.core.dom.VariableDeclaration.resolveBinding(
at org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment.accept0(
at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(
at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(
at org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement.accept0(
at org.eclipse.wst.jsdt.core.dom.ASTNode.accept(
at org.eclipse.wst.jsdt.core.dom.ASTNode.acceptChildren(
# pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime-devel msys2-runtime
# pacman -Syu
# Since pacman, you can just
# Run **`pacman -Syuu`**. Follow the instructions. Repeat this step until it says there are no packages to update.
pacman -Syuu
LFLAGS="-static-libstdc++ -static-libgcc" CXXFLAGS="-static-libgcc -static-libstdc++" CC="gcc -Wall" make clean all V=1
# Inspired by
# pthread tendy to link dynamically, I prefer it statically linked
# Fix missing platform prefix for windres
[ -f /mingw64/bin/x86_64-w64-mingw32-windres.exe ] || ln -s /mingw64/bin/windres.exe /mingw64/bin/x86_64-w64-mingw32-windres.exe
[ -f /mingw32/bin/i686-w64-mingw32-windres.exe ] || ln -s /mingw32/bin/windres.exe /mingw32/bin/i686-w64-mingw32-windres.exe
# Even when statically linking to libstdc++, it still tries to dynamically link to lib(win)pthread. On top of it, libtool is too
# stupid to recognize the semantics of -Wl,-Bstatic. This leaves one option: Removing the dynamic import libraries.
rm /mingw32/i686-w64-mingw32/lib/libpthread.dll.a
rm /mingw32/i686-w64-mingw32/lib/libwinpthread.dll.a
bardware / Exception Stack Trace
Last active Mar 16, 2017
Unhandled event loop exception
View Exception Stack Trace
org.eclipse.swt.SWTException: Failed to execute runnable (java.util.ConcurrentModificationException)
at org.eclipse.swt.SWT.error(
at org.eclipse.swt.SWT.error(
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(
at org.eclipse.swt.widgets.Display.runAsyncMessages(
at org.eclipse.swt.widgets.Display.readAndDispatch(
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$
at org.eclipse.core.databinding.observable.Realm.runWithDefault(
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(
View MyTest.cfm
<cfset test = new MyTest() />
<cfset test.newMethod() />
View MyTest.cfc
component accessors="true" {
property name="privateVarOne" default="privateVarOne default";
function init() {
return this;
public void function newMethod() {
var myVar = variables.privateVarOne;