Skip to content

Instantly share code, notes, and snippets.

View xgenvn's full-sized avatar

TuNA xgenvn

View GitHub Profile
@xgenvn
xgenvn / web_ui_elements_naming_convention.md
Last active August 8, 2017 01:14 — forked from hosuaby/web_ui_elements_naming_convention.md
Simple convention for naming GUI elements of Web applications

Simple convention for naming GUI elements of Web applications

Ids or names of elements (primitives or complexes) must be written in Camel Case and must to be as short as possible. All id or name must to start with one of the defined element type prefixes.

Element type prefixes

All element ids or names must use Hungarian notation to incorporate the type of element. Prefixes are used to indicate the semantic type of the element, rather than it's underlining implementation. It means that the element of GUI with button look & feel must prefixed as btn, regardless of how it is implemented, with tag <button> or with tag <a>.
Prefixes are lowercase strings of 2, 3 or 4 characters. Here a complete list of authorised prefixes:

  • btn - the button or a link with a button look & feel
@xgenvn
xgenvn / Free O'Reilly Books.md
Created August 19, 2017 15:16 — forked from augbog/Free O'Reilly Books.md
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@xgenvn
xgenvn / 01_GreetingAspect.cs
Created October 5, 2017 04:11 — forked from manadart/01_GreetingAspect.cs
Example usage of TinyIoC - the first with constructor injection, the second with property injection.
namespace TinyIoCDemo
{
// This is the interface for my aspect - the dependency for my classes.
public interface IAspectDependency
{
string GetGreeting();
}
// And here is an implementation.
public class GreetingAspect : IAspectDependency
#!/bin/bash -e
# ubuntu-docker-install.sh
#
# Quick-usage:
#
# wget https://gist.githubusercontent.com/deanrather/9da36d690bd9b57c33fb3ddeb4321cc7/raw/ubuntu-docker-install.sh -O - | sh
#
# https://docs.docker.com/engine/installation/linux/ubuntulinux/
# https://github.com/docker/compose/releases
#
@xgenvn
xgenvn / css-selectors.md
Created October 18, 2017 01:26 — forked from magicznyleszek/css-selectors.md
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Element selectors

Element -- selects all h2 elements on the page

h2 {
    foo: bar;
@xgenvn
xgenvn / aes-example.cs
Created October 19, 2017 15:51 — forked from yetanotherchris/aes-example.cs
C# AES asymmetric encryption and decryption example
string ivAsBase64;
string encryptedTextAsBase64;
string keyAsBase64;
using (AesCryptoServiceProvider aes = new AesCryptoServiceProvider())
{
// Store the IV (they can be stored if you don't re-use a key)
aes.GenerateIV();
byte[] iv = aes.IV;
ivAsBase64 = Convert.ToBase64String(iv);
@xgenvn
xgenvn / darkconemu.xml
Created October 24, 2017 02:06 — forked from JanDeDobbeleer/darkconemu.xml
DarkConEmu.xml
<key name="Palette4" modified="2016-08-07 14:21:13" build="160724">
<value name="Name" type="string" data="DarkConEmu"/>
<value name="ExtendColors" type="hex" data="01"/>
<value name="ExtendColorIdx" type="hex" data="0f"/>
<value name="TextColorIdx" type="hex" data="0f"/>
<value name="BackColorIdx" type="hex" data="0d"/>
<value name="PopTextColorIdx" type="hex" data="0d"/>
<value name="PopBackColorIdx" type="hex" data="0d"/>
<value name="ColorTable00" type="dword" data="001e1e1e"/>
<value name="ColorTable01" type="dword" data="00cc7a00"/>
@xgenvn
xgenvn / DockerRedis_ExportImport_Dump.sh
Created November 1, 2017 17:57 — forked from alister/DockerRedis_ExportImport_Dump.sh
Example of creating a Docker data volume, exporting it, and re-importing it to a completely fresh container
# Create the container - we run 'echo' in the container, and reuse the same as we will be running later
docker run -d -v /data --name redis.data dockerfile/redis echo Data-only container for Redis
# the data container doesn't show up - nothing is running
docker ps
# will show 'redis.data', but as stopped
docker ps -a
# start redis, attach to 'redis.data'
docker run -d -p 6379:6379 --volumes-from redis.data --name ca.redis.1 dockerfile/redis
@xgenvn
xgenvn / README.md
Created November 6, 2017 14:40 — forked from hofmannsven/README.md
My simply Git Cheatsheet