Skip to content

Instantly share code, notes, and snippets.

@dploeger
dploeger / htpasswd.erb
Created September 19, 2018 13:06
HTPasswd management using Puppet
<% @accounts.each do |user, password| -%>
<%= user %>:<%= scope.call_function('apache_pw_hash', [password]) %>
<% end -%>
package de.dieploegers.develop.idea.custommark
import com.intellij.openapi.editor.EditorLinePainter
import com.intellij.openapi.editor.LineExtensionInfo
import com.intellij.openapi.editor.markup.EffectType
import com.intellij.openapi.editor.markup.TextAttributes
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import java.awt.Color
package de.dieploegers.develop.idea.custommark
import com.intellij.codeInsight.daemon.RelatedItemLineMarkerInfo
import com.intellij.codeInsight.daemon.RelatedItemLineMarkerProvider
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder
import com.intellij.icons.AllIcons
import com.intellij.ide.util.DefaultPsiElementCellRenderer
import com.intellij.psi.PsiElement
import java.awt.Color
<idea-plugin>
<id>de.dieploegers.develop.idea.custommark</id>
<name>Custom Mark</name>
<version>0.1.0</version>
<vendor email="develop@dieploegers.de" url="http://www.yourcompany.com">YourCompany</vendor>
<description><![CDATA[
Create custom markings based on regular expressions.
]]></description>
package de.dieploegers.develop.idea.custommark.annotators
import com.intellij.lang.annotation.AnnotationHolder
import com.intellij.lang.annotation.Annotator
import com.intellij.lang.annotation.HighlightSeverity
import com.intellij.openapi.editor.markup.EffectType
import com.intellij.openapi.editor.markup.TextAttributes
import com.intellij.psi.PsiElement
import java.awt.Color
@dploeger
dploeger / Migration.md
Last active April 18, 2018 03:26
Migration Notes Godot 2 => Godot 3
let Vaulted = require('vaulted');
let fs = require('fs');
let myVault = new Vaulted({
vault_host: 'localhost',
vault_port: 8200,
vault_ssl: false
});
myVault.prepare()
@dploeger
dploeger / UnirestAsPromise.ts
Created September 11, 2017 09:26
Unirest as Promise (Typescript)
import Bluebird = require('bluebird');
import {UnirestError} from './UnirestError';
/**
* A tool for converting a unirest object into a promise
* @param unirest The unirest instance
* @returns {Bluebird<any>}
*/
export function unirestAsPromise(unirest: any): Bluebird<any> {
return new Bluebird(
@dploeger
dploeger / Touchbar System Stats.json
Created June 28, 2017 06:59
System Stats (CPU load, Free Memory, Free disk space) for Apple Touchbar using Bettertouchtool
{
"BTTPresetName" : "Touchbar System Stats",
"BTTPresetUUID" : "5BCAEC41-D306-4BB6-B172-F9EBB974D4D3",
"BTTPresetContent" : [
{
"BTTAppBundleIdentifier" : "BT.G",
"BTTAppName" : "Global",
"BTTAppSpecificSettings" : {
},
@dploeger
dploeger / bitshifter.patch
Created March 13, 2017 08:27
nibtools bitshifter.c patch for macOS
Index: bitshifter.c
===================================================================
--- bitshifter.c (revision 637)
+++ bitshifter.c (working copy)
@@ -439,13 +439,25 @@
// > 0 <= C <= 7 (see above)
// > *b = Next bit position to be copied from 'db' (1 <= B <= 8)
// > [ ((Q << C) & 0xff00) + new bits from db ] >> C
- **q = ( ( (__int32)((**q) >> (8-*c)) << 8) | (((__int32)db << (*b-1)) & 0xff) ) >> *c;
+ **q = ( ( (int32_t)((**q) >> (8-*c)) << 8) | (((int32_t)db << (*b-1)) & 0xff) ) >> *c;