Skip to content

Instantly share code, notes, and snippets.

View vietdien2005's full-sized avatar
🦉
there's something dark inside

Dam Viet vietdien2005

🦉
there's something dark inside
View GitHub Profile
@vietdien2005
vietdien2005 / QueryBuilderQuery.php
Created December 14, 2016 05:11 — forked from alexander-torosh/QueryBuilderQuery.php
Example of using Phalcon Query Builder and Columns method
<?php
$qb = $this->modelsManager->createBuilder()
->columns(['e.*', 'i.*'])
->addFrom('Backend\Models\Event', 'e')
->innerJoin('Backend\Models\Image', 'e.id = i.event_id', 'i')
->where('e.id = :id:', ['id' => $some_id]);
$entries = $qb->getQuery()->execute();
#! /usr/bin/python3
import pyautogui
import time
# Uncomment below to take position your cursor
# try:
# while True:
# x, y = pyautogui.position()
# positionStr = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4)
# print(positionStr, end='')
  • Create your public key and private key
// Config RSA
$config = [
    "digest_alg"       => "sha512",
    "private_key_bits" => 2048,
    "private_key_type" => OPENSSL_KEYTYPE_RSA,
];

// Create the private and public key
@vietdien2005
vietdien2005 / encryptor.md
Created April 9, 2017 09:54
encrypt decrypt id number
function encryptor($action, $string) {
    $output = false;

    $encrypt_method = "AES-256-CBC";
    //pls set your unique hashing key
    $secret_key = 'dj7oiop1mkdp251EnCrIt4QKq4988w6a';
    $secret_iv = 'oeuGJW0cBI4ye998Z7435sj9EkGnDD34';

 // hash
@vietdien2005
vietdien2005 / Theming-Slack-OSX.md
Created May 25, 2017 08:36 — forked from mswieboda/Theming-Slack-OSX.md
Theming Slack for OSX 🕶️

Theming Slack for OSX

So, you love Slack, but you hate applications with large white backgrounds? Why not use Dark Mode! 🕶️

Unfortunately, Slack does not have a Dark Mode, although it's on their list of possibilities.

But, don't fret - there is a solution! Because the slack native desktop apps are just wrappers around a web app, we can inject our own CSS to customize the application to our liking.

(I take no credit for this exploit, graciously found via @DrewML https://gist.github.com/DrewML/0acd2e389492e7d9d6be63386d75dd99 and suggestions by @bradens, @jouni, @gkostov and others).

@vietdien2005
vietdien2005 / slack-dark-theme
Created May 25, 2017 08:55
css dark theme slack
#msgs_scroller_div::-webkit-scrollbar-track, #client_body::before, .client_container,
#search_terms, #client_body, #footer, ts-message, .channel_header, ts-jumper ts-jumper-container,
ts-jumper input[type="text"],
.supports_custom_scrollbar:not(.slim_scrollbar) #col_channels:hover #channels_scroller::-webkit-scrollbar-track{
background: #333 !important;
}
#client_body::before {
border-bottom: 1px solid #1a2129 !important;
}
.cm-s-cobalt.CodeMirror { background: #002240; color: white; }
.cm-s-cobalt div.CodeMirror-selected { background: #b36539; }
.cm-s-cobalt .CodeMirror-line::selection, .cm-s-cobalt .CodeMirror-line > span::selection, .cm-s-cobalt .CodeMirror-line > span > span::selection { background: rgba(179, 101, 57, .99); }
.cm-s-cobalt .CodeMirror-line::-moz-selection, .cm-s-cobalt .CodeMirror-line > span::-moz-selection, .cm-s-cobalt .CodeMirror-line > span > span::-moz-selection { background: rgba(179, 101, 57, .99); }
.cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; }
.cm-s-cobalt .CodeMirror-guttermarker { color: #ffee80; }
.cm-s-cobalt .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
.cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; }
.cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white; }
@vietdien2005
vietdien2005 / create-docker-tls.sh
Created June 1, 2017 02:47 — forked from Stono/create-docker-tls.sh
Creating and setting up Docker for TLS
#!/bin/bash
# This script will help you setup Docker for TLS authentication.
# Run it passing in the arguement for the FQDN of your docker server
#
# For example:
# ./create-docker-tls.sh myhost.docker.com
#
# The script will also create a profile.d (if it exists) entry
# which configures your docker client to use TLS
#
@vietdien2005
vietdien2005 / install.sh
Created August 13, 2017 15:13 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@vietdien2005
vietdien2005 / jenkins-theme-material.css
Last active August 15, 2017 02:28
jenkins-theme-material.css
@import url(https://fonts.googleapis.com/css?family=Roboto:400,700,500,300);@import url(https://fonts.googleapis.com/css?family=Roboto+Mono:400,700,500,300);.CodeMirror pre,body{line-height:20px!important}#header,.top-sticker-inner{box-shadow:0 1px 5px 0 rgba(0,0,0,.16),0 2px 10px 0 rgba(0,0,0,.12)}.bottom-sticker-edge,.task-link[href="/"]{display:none}.task-icon-link[href="/"]:hover,a#jenkins-home-link{opacity:1!important}#header .icon-help,.yuimenuitem-selected>a>img{filter:brightness(10000)}@keyframes a{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes b{0%,to{opacity:1}50%{opacity:0}}[src$="blue.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDA5Njg4IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptLTIgMTVsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=)}[src$="red.png"]{background-image:url(