Skip to content

Instantly share code, notes, and snippets.

View marffinn's full-sized avatar
🏠
Working from home

Tomasz Drozdowski marffinn

🏠
Working from home
View GitHub Profile
@marffinn
marffinn / custom-nav-walker-usage.php
Created June 12, 2018 10:40 — forked from kosinix/custom-nav-walker-usage.php
WordPress: Using a custom nav walker to create navigation menus in plain <a> tags. That is the <ul> and <li> tags are not present. Very useful if you want to create simple links that can be centered with a simple text-align:center on the containing element.
<?php
// In your template files like footer.php
// The items_wrap value ('%3$s') removes the wrapping <ul>, while the custom walker (Nav_Footer_Walker) removes the <li>'s.
wp_nav_menu(array('items_wrap'=> '%3$s', 'walker' => new Nav_Footer_Walker(), 'container'=>false, 'menu_class' => '', 'theme_location'=>'footer', 'fallback_cb'=>false ));
?>
@marffinn
marffinn / app.js
Created June 6, 2021 20:54 — forked from dtrenz/app.js
Example node + socket.io chat app using express.
#!/usr/bin/env node
var express = require('express');
var app = express();
var server_port = process.env.PORT || 5000;
var server = require('http').createServer(app);
var io = require('socket.io').listen(server);
var users = {};
server.listen(server_port);
@marffinn
marffinn / electron-packager-extra-resource.md
Created February 17, 2022 12:04 — forked from fodra/electron-packager-extra-resource.md
Command to add extra resources in your electron app

This is the example usage of electron-packager that I never found online anywhere else.

To add resource.exe and resource2.dll in the resource folder when you create an installer, this is how you do it with the --extra-resource commandline switch.

--extra-resource

electron-packager . --overwrite --asar --extra-resource="resource1.exe" --extra-resource="resource2.dll" --platform=win32 --arch=ia32 --icon=./frontend/dist/assets/icon.ico --prune=true --out=./build --version-string.ProductName='Hot Pan de sal'

within the backend code you can refer to the files as: