Skip to content

Instantly share code, notes, and snippets.

View Namek's full-sized avatar
💻

Kamil Dąbrowski Namek

💻
View GitHub Profile
@Namek
Namek / build.zig
Last active March 10, 2023 19:33
getty-zig: unitialized struct field that is not found in JSON gets freed causing segmentation fault
const std = @import("std");
// Although this function looks imperative, note that its job is to
// declaratively construct a build graph that will be executed by an external
// runner.
pub fn build(b: *std.Build) void {
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
// for restricting supported target set are available.
@Namek
Namek / Dockerfile
Created December 6, 2017 00:08
Docker compose: elixir-node@ubuntu + postgres@alpine
FROM elixir:1.5
EXPOSE 8080
ENV PORT=8080 MIX_ENV=prod
ENV LANG=C.UTF-8
RUN apt-get update && mix local.hex --force && mix local.rebar --force
# Install node.js and Elm
RUN curl -sL https://deb.nodesource.com/setup_8.x \
@Namek
Namek / JfxTestRunner.java
Created May 24, 2016 20:21 — forked from bugabinga/JfxTestRunner.java
This runner can be used to run JUnit-Tests on the JavaFx-Thread.
/**
* © 2015 isp-insoft all rights reserved.
*/
package com.isp.lpt;
import java.util.concurrent.CountDownLatch;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.InitializationError;
@Namek
Namek / gist:2e6100f30dca16769367
Created March 5, 2016 20:37
Research: TheConsole2 - console output view
JavaFX TextArea:
JavaFX WebView:
+ easily selectable for copying
- hard to display image downloaded by script
- not efficient
- required to wait for engine load asynchronously
JavaFX TextFlow:
@Namek
Namek / PersistentRouterOutlet.ts
Last active January 25, 2016 09:53 — forked from waeljammal/PersistentRouterOutlet.ts
Angular 2 Persistent Router
import * as hookMod from 'angular2/src/router/lifecycle_annotations';
import * as routerMod from 'angular2/src/router/router';
import {isBlank, isPresent, Json} from 'angular2/src/facade/lang';
import {StringMapWrapper} from 'angular2/src/facade/collection';
import {Promise, PromiseWrapper} from 'angular2/src/facade/async';
import {BaseException} from 'angular2/src/facade/exceptions';
import {
ElementRef, DynamicComponentLoader, Directive, Injector, provide, ComponentRef, Attribute
} from 'angular2/core';
import {
@Namek
Namek / app.ts
Created January 23, 2016 01:29
Angular 2 directive: two-way binding to contenteditable
@Component({
selector: 'test-component'
})
@View({
directives: [ContenteditableModel]
template: `
<h1 contenteditable="true" [(contenteditableModel)]="someObj.someProperty"></h1>
{{someObj | json}}
`
})
@Namek
Namek / script.js
Created November 4, 2015 19:39
Tampermonkey script: Different Trello background every day Raw
// ==UserScript==
// @name Trello
// @namespace http://namekdev.net
// @version 0.2
// @description different Trello background every day
// @author Namek
// @include /^https?://trello\.com/?.*$/
// @grant none
// ==/UserScript==
@Namek
Namek / main.js
Created October 15, 2015 14:02
Materialize website
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
@Namek
Namek / Callback.cpp
Last active August 29, 2015 14:08
C++ inline Assembler hack back in 2008.
#include "stdafx.hpp"
using namespace NFR;
//
// CCallbackIdCreator
//
CCallbackIdCreator::CCallbackIdCreator()
{
@Namek
Namek / TagsLayersEnumBuilder.cs
Last active February 26, 2023 21:28
Tags and Layers Enums Builder for Unity3D
#if UNITY_EDITOR
using UnityEngine;
using System.Collections;
using UnityEditor;
using System;
using System.IO;
using System.Text;
public class TagsLayersEnumBuilder : EditorWindow {
[MenuItem("Edit/Rebuild Tags And Layers Enums")]