Skip to content

Instantly share code, notes, and snippets.

View vladdu's full-sized avatar

Vlad Dumitrescu vladdu

  • Göteborg, Sweden
View GitHub Profile
@vladdu
vladdu / TailwindCSS setup for skins
Last active March 4, 2023 07:27
TailwindCSS setup for skins
TailwindCSS setup for skins

After checking https://github.com/tailwindui/vue, I think that if we use Tailwind and Alpine, we could implement components with HTML only (maybe not as advanced as with Vue, but to a point).

And that means that we could use something like partials. So I gave it a try. A new tag is needed, because currently partial is not a pair tag.

The change I did to the partial tag is to parse $this->content and provide it to the view renreer as add content.

 public function wildcard($tag)
    {
        // We pass the original non-studly case value in as
@vladdu
vladdu / Wrapped.xtend
Created March 29, 2019 15:25
xtend annotation: @wrapped (for more meaningful strings and integers)
package aaa
import java.lang.annotation.ElementType
import java.lang.annotation.Retention
import java.lang.annotation.Target
import java.lang.ref.WeakReference
import java.util.WeakHashMap
import org.eclipse.xtend.lib.macro.AbstractClassProcessor
import org.eclipse.xtend.lib.macro.Active
import org.eclipse.xtend.lib.macro.TransformationContext
@vladdu
vladdu / main.js
Last active January 25, 2022 18:54 — forked from kdzwinel/main.js
List all undefined CSS classes
/*
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets.
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there).
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: https://babeljs.io/repl/ .
Known limitations:
- it won't be able to take into account some external stylesheets (if CORS isn't set up)
- it will produce false negatives for classes that are mentioned in the comments.
@vladdu
vladdu / reset.css
Last active February 19, 2019 20:21
*
{
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
a
{
color: inherit;
text-decoration: none;
@vladdu
vladdu / url.php
Created August 26, 2018 14:02
check if a link is broken with php
function check_url($url) {
$headers = @get_headers( $url);
$headers = (is_array($headers)) ? implode( "\n ", $headers) : $headers;
return (bool)preg_match('#^HTTP/.*\s+[(200|301|302)]+\s#i', $headers);
}

Keybase proof

I hereby claim:

  • I am vladdu on github.
  • I am vladdu (https://keybase.io/vladdu) on keybase.
  • I have a public key ASAWkxcV1D3BviqD8bnrKfIPlFfDtl5rkBZ4QGpq2Mp6Qgo

To claim this, I am signing this object:

@vladdu
vladdu / cancellable_worker.erl
Last active November 24, 2016 14:05
Cancellable worker process
-module(cancellable_worker).
-behaviour(gen_server).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
%% ====================================================================
%% API functions
%% ====================================================================
get_application_doc(A) ->...
% from edoc in the sources
get_module_source_doc(M) ->...
% from external files
get_module_external_doc(M) ->...
get_function_spec(M, F, A) ->...
import org.eclipse.core.runtime.Path;
public interface IPreferenceNotifier {
void changed(Path path, String key, String newValue);
void added(Path path, String key);
void removed(Path path, String key);