Archive for July 2017

Css list with curly brackets

ol { counter-reset: list; } ol > li { list-style: none; } ol > li:before { content: counter(list) ") "; counter-increment: list; } Output: 1) Number1 2) Number2 3) Number3

Hard reset of local branch to match remote

git reset –hard origin/develop

See local changes not pushed to remote

git diff origin/develop..HEAD git log origin/develop..HEAD

Benefits of running web app inside docker

Your server itself will not have a big stack installed, like LAMP: all your server needs to know is how to run docker containers. If you deploy an app with a vulnerability and hackers gain root, they will only have root inside a single docker container, and can’t get at your host system. If you […]

jQuery finding next “child” and previous “parent” objects

<script type="text/javascript"> … $parent = $(’#yourobject’).parent(); $child = $(’#yourobject’).children(’:first’); … </script>

Ubuntu keyboard layout change

[Ctrl] + [Super] + [Space] Super: on some keyboards it has Windows logo

Ubuntu monitor configuration filename

$HOME/.config/monitors.xml Example: <monitors version="1"> <configuration> <clone>no</clone> <output name="eDP-1"> <vendor>BOE</vendor> <product>0x0653</product> <serial>0x00000000</serial> <width>1920</width> <height>1080</height> <rate>60</rate> <x>3840</x> <y>0</y> <rotation>normal</rotation> <reflect_x>no</reflect_x> <reflect_y>no</reflect_y> <primary>no</primary> </output> <output name="DP-1"> <vendor>BNQ</vendor> <product>0x8016</product> <serial>0x00005445</serial> <width>1920</width> <height>1080</height> <rate>60</rate> <x>1920</x> <y>0</y> <rotation>normal</rotation> <reflect_x>no</reflect_x> <reflect_y>no</reflect_y> <primary>yes</primary> </output> </configuration> </monitors>

Select #id with word as prefix and counter as suffix

<a id="my-favourite1"/ class="added"> <a id="my-favourite2"/ class="add"> <a id="my-favourite3"/ class="add"> <a id="my-favourite4"/ class="added"> <a id="my-favourite5"/ class="added"> <script type="text/javascript">   $(’a[id^=my-favourite]’).on(’click’, function (e) { console.log(’Clicked’); console.log(this.id); console.(this.id.removeClass(’added’).addClass(’add’)); } ); </script>