Skip to content

Instantly share code, notes, and snippets.

@derFunk
derFunk / long_screenshot.js
Created February 26, 2018 07:54
Long screenshots with headless chrome, avoiding the 16384 pixel count limitation (texture size)
#!/usr/bin/env node
function sleep(ms) {
ms = (ms) ? ms : 0;
return new Promise(resolve => {setTimeout(resolve, ms);});
}
process.on('uncaughtException', (error) => {
console.error(error);
process.exit(1);
});
@derFunk
derFunk / generate-compose.sh
Last active December 27, 2017 10:48 — forked from lalyos/generate-compose.sh
generate docker-compose.yml by inspecting a running container
docker-yml() {
docker inspect -f $'
version: '2.2'
services:
{{.Name}}
image: {{.Config.Image}}
entrypoint: {{json .Config.Entrypoint}}
command: {{json .Config.Cmd}}
environment: {{range .Config.Env}}
- {{.}}{{end}}

Keybase proof

I hereby claim:

  • I am derFunk on github.
  • I am derfunk (https://keybase.io/derfunk) on keybase.
  • I have a public key whose fingerprint is E569 9481 B960 CEA5 BC81 3CE2 81F8 58E2 46A0 4A97

To claim this, I am signing this object:

@derFunk
derFunk / UnityNodeTypeResolver.cs
Last active November 1, 2023 11:51
NodeTypeResolver for YamlDotNet to ease deserializing Unity3D scene files
using System;
using System.Collections.Generic;
using System.Reflection;
using YamlDotNet.Core.Events;
using YamlDotNet.Serialization;
namespace Chimera.Unity3DYamlChecker
{
class UnityNodeTypeResolver : INodeTypeResolver
{
@derFunk
derFunk / bacula-fd.rb
Created January 27, 2015 15:00
OSX brew formula for Bacula 5.2.6 to be compatible with current Debian Wheezy Bacula package.
require 'formula'
class BaculaFd < Formula
homepage 'http://www.bacula.org/'
# you may exchange this download url to match the correct bacula source code, if Debian once updates it's own package
url 'http://downloads.sourceforge.net/project/bacula/z-older-releases/5.2.6/bacula-5.2.6.tar.gz'
def install
system "./configure", "--prefix=#{prefix}",
"--sbindir=#{bin}",
"--with-working-dir=#{var}/lib/bacula",
@derFunk
derFunk / floatsign.sh
Last active June 3, 2016 01:44 — forked from mediabounds/floatsign.sh
Allow for different keychain usage and allow for resigning with Xcode > 6 (removed --resource-rules parameter)
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@derFunk
derFunk / ReliablyDetectArt.java
Created June 18, 2014 10:24
Reliably Detect ART Runtime on Android KitKat
/**
* Checks if the device is using the (still experimental Android Runtime (ART))
* @return Returns true if ART is used on the device.
*/
public static boolean isART()
{
if (Build.VERSION.SDK_INT < 19) // Before KITKAT, as ART is only available since 4.4.x
return false ;
try{
@derFunk
derFunk / BinarySerializedTests.cs
Created August 30, 2012 16:56
Cached binary serialization unit tests for ServiceStack
using System;
using System.Text;
using NUnit.Framework;
using ServiceStack.Plugins.ProtoBuf;
using ServiceStack.ServiceClient.Web;
using ServiceStack.Text;
namespace ServiceStack.WebHost.IntegrationTests.Tests
{
[TestFixture]
@derFunk
derFunk / DeviceInfo.java
Created August 3, 2012 08:49
Android device info bridge for Unity 3D
package de.chimeraentertainment.tools;
import android.content.Context;
import android.view.WindowManager;
import de.chimeraentertainment.namespace.<<YourMainActivity>>;
import android.util.DisplayMetrics;
import android.util.Log;
public class DeviceInfo {