Skip to content

Instantly share code, notes, and snippets.

Mr. However rolfen

Block or report user

Report or block rolfen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rolfen
rolfen / README.md
Last active Oct 7, 2018
git workflow
View README.md

For example, let's start a project based on the inferno-starter skeleton which is hosted on github. Consider that we want to host it somewhere else, such as on bitbucket.

Normally the easiest way to get started is to fork the skeleton on github, then clone the fork to your local machine and start working.

One of the advantages is that we are not forking, therefore we are not limited to host the resulting repository on github. We can host it anywhere else or just keep it on our local machine.

git clone https://github.com/rolfen/inferno-starter.git
cd inferno-starter
git remote rename origin inferno-starter
@rolfen
rolfen / EMAIL.md
Last active Aug 18, 2018
Setting up a Linux server
View EMAIL.md
View 0000 Readme.md

My Media Archive

Life without Lightroom

@rolfen
rolfen / MySqlExportBlob.md
Last active May 22, 2019
Exporting multiple blobs/images from an SQL database
View MySqlExportBlob.md

Exporting multiple blobs from an SQL database.

This is tested for MySQL with Linux or OSX

I was in a situation where I had images saved into an SQL table, as "blobs" and needed to export them into proper jpg files.

This relies on the SQL syntax SELECT INTO DUMPFILE. However this command can only export one row at a time.

1. Get the IDs of the rows we want to export

@rolfen
rolfen / README.md
Last active May 11, 2018
Privacy Tunnel
View README.md

I am concerned with:

  • Network administrator(s), ISP snopping on communications, knowing which sites I have visited
  • Cloud service providers such as Facebook, google knowing where I am through my IP

You need a Linux VPS or computer as remote. I have a Debian VPS.

Method 1: SSH tunnel

The remote should be running SSHd.

@rolfen
rolfen / gist:c57e4606856f900c654fabb5cf9a34b6
Last active Feb 20, 2018
Weston dropdown positioning bug
View gist:c57e4606856f900c654fabb5cf9a34b6
Sometimes drop-down or contextual menus appear at the wrong position on the screen.
Upon moving the parent window, it appears that the menu position is not updated. They still appear at the same position.
To reproduce with affected applications, open app, open drop-down menu, move app window, open same drowpdown menu - observe that the menu has not moved with the window and is subsequently now appearing at a wrong position.
If the window is resized, the menus get re-aligned.
Weston 3.0.0
(running in DRM mode)
There is such a bug in sway too. But over there it seems to affect everything (pcmanfm, lxterminal, subl, chromium...)
@rolfen
rolfen / ReadMe.md
Last active Jun 25, 2018
Get GPS coordinates for major cities
View ReadMe.md
View take-that-css.js
/*
* A javascript-based flow experiment.
* Grew out of my frustration for CSS. I wanted container child elements to flow but also wanted to absolutely position them in one dimention.
* Set class `.js-flow` on the container - children must also have `position:absolute`
* The children will appear flowed, as if they were inline blocks.
* However this is done by setting `left` inside the `style` attribute so it pretty much kills CSS flow and responsiveness.
* Also this is basic, one dimentional (X); do not expect your elements to wrap or do anything fancy.
*/
var flowItem, flowContainer, flowDocument;
@rolfen
rolfen / funcs.php
Last active Oct 23, 2017
PHP functions
View funcs.php
<?php
// ============ strings ================
function smart_truncate($string, $limit, $break=" ", $pad="...") {
// truncates string to the first $break after $limit characters, then adds $pad to the end
// Original PHP code by Chirp Internet: www.chirp.com.au
// Please acknowledge use of this code by including this header.
// return with no change if string is shorter than $limit
$string = strip_tags($string);
You can’t perform that action at this time.