Skip to content

Instantly share code, notes, and snippets.

View stromnet's full-sized avatar

Johan stromnet

  • Stromnet
  • Sweden
View GitHub Profile
"""
https://youtrack.jetbrains.com/issue/IDEA-208989
Mini hack script to ensure UPDATE_BRANCHES_INFO is set to false in IDEA workspace.xml files
Typical file structure:
<project>
...
<component name="Git.Settings">
...
<option name="UPDATE_BRANCHES_INFO" value="false" />
<?xml version="1.0" encoding="UTF-8"?>
<!--
Locus Maps providers.xml for Hitta.se.
Place in /<SDCARD>/Locus/mapsOnline/custom/hitta-se.xml
-->
<providers>
<provider id="15000" type="1" visible="true" required="true" background="0">
<name>Hitta.se</name>
<mode>Karta</mode>
<url><![CDATA[http://static.hitta.se/tile/v3/0/{z}/{x}/{y}]]></url>
@stromnet
stromnet / 1password-to-keepassx.py
Created June 26, 2016 12:21
Simple script to convert a 1Password DB export into a KeePassX 0.4 XML file (which can be converted to a KeePassX 2.0 DB for use on OS X)
import sys
from xml.sax.saxutils import escape
# python-based 1Password export DB -> KeePassX import XML file
# Similar to https://github.com/adamaltman/1Password-to-Keepassx/blob/master/convert.php
# but written in Python (which exists on MacOSX by default)
#
# EXPORT (in 3.8, may differe in newer versions):
# 1. Open 1Password, unlock keychain.
# 2. Select File -> Export All -> Text File...
@stromnet
stromnet / gist:a1cd1c2ec75fc944fec4
Created November 9, 2015 21:04
moat poll patch
diff --git a/moat.c b/moat.c
index 7cd9951..3b4992a 100644
--- a/moat.c
+++ b/moat.c
@@ -189,16 +189,19 @@ static void moat_write(void)
void moat_poll(void)
{
static uint8_t i = 0;
+ DDRD|=(1<<7);
+ PORTD|=(1<<7);
@stromnet
stromnet / password_mangler.asm
Last active October 6, 2015 07:51
HI3518 ActiveX password mangler in ASM
.text:1000E100 password_mangler proc near ; CODE XREF: sub_10002000+341p
.text:1000E100 ; sub_10002930+4E6p ...
.text:1000E100
.text:1000E100 var_18 = byte ptr -18h
.text:1000E100 var_8 = dword ptr -8
.text:1000E100
.text:1000E100 sub esp, 18h
.text:1000E103 mov eax, dword_100C74E0
.text:1000E108 xor eax, esp
.text:1000E10A mov [esp+18h+var_8], eax
@Test
public void testPojo() throws IOException{
ObjectMapper objectMapper = new ObjectMapper();
// private_id, protected_id are not settable
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
Pojo p = objectMapper.readValue("{\"private_id\":1,\"protected_id\":2,\"public_id\":3,\"protectedWithGetter\":4}", Pojo.class);
assertEquals(0, p.private_id); // private is not writable
assertEquals(0, p.protected_id); // protected is not writable
@stromnet
stromnet / gist:57e2ec3405a4194346b6
Last active August 29, 2015 14:08
FreeBSD Salt state to disable sshd and replace with openssh-portable
openssh:
pkg.installed:
- name: openssh-portable
service:
- running
- enable: True
- require:
- pkg: openssh-portable
- service: base-sshd-removed
@stromnet
stromnet / app.js
Last active August 29, 2015 14:07 — forked from marcoslin/app.js
define(['angularAMD', 'angular-route'], function (angularAMD) {
var app = angular.module("webapp", ['ngRoute']);
app.config(function ($routeProvider) {
$routeProvider
.when("/home", angularAMD.route({
templateUrl: 'view_home.html', controller: 'HomeCtrl', controllerUrl: 'controller_home'
}))
.when("/view1", angularAMD.route({
templateUrl: 'view_view1.html', controller: 'View1Ctrl', controllerUrl: 'controller_view1'
// Ugly hax which have not been tested.. :)
char dummyOutput[] = "artist: internets\ntitle: elektronikvisan\n";
char * findTitle() {
char lookFor[] = "title: ";
char *titleStart, *titleEnd;
titleStart = strstr(dummyOutput, lookFor);
if(!titleStart)
@stromnet
stromnet / gist:5568329
Created May 13, 2013 13:34
OpenJDK vs Oracle JDK FutureTask differences
import java.util.concurrent.*;
public class test{
public static void main(String[]args){
System.out.println("testFutureTask");
Runnable r = new Runnable(){
public void run(){}
};