Skip to content

Instantly share code, notes, and snippets.

View tranghaviet's full-sized avatar

Ha Viet Trang tranghaviet

View GitHub Profile
@pksunkara
pksunkara / config
Last active November 15, 2024 16:02
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@ocean90
ocean90 / box-shadow.html
Last active September 3, 2024 16:56
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
/*
* Simple MD5 implementation
*
* Compile with: gcc -o md5 -O3 -lm md5.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
@kamipo
kamipo / gist:61ee662ee0b1127f0989
Last active August 28, 2018 01:51
MySQL Unicode Collation Behavior

MySQL Unicode character set has following collations mainly:

  • xxx_bin: compare all characters by these code point as weight.
  • xxx_general_ci: compare almost characters by these code point as weight.
  • xxx_unicode_ci: compare all characters by these collating weight.

ref. http://dev.mysql.com/doc/refman/5.6/en/charset-unicode-sets.html

When xxx is utf8, can treat only BMP characters.

@gilbitron
gilbitron / .env.travis
Last active August 12, 2023 08:06
Laravel 5 Travis CI config
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active October 23, 2024 13:16
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

Map
.find({
artistId: Utils.convertToObjectId(user._id)
})
.select("nameUrl status mapType created sliders")
.populate({
path: 'sliders',
select: 'name No createdAt works',
populate: [{
path: 'works',
@sadikaya
sadikaya / git-bash-in-webstorm.md
Last active September 23, 2024 17:50
git bash inside Webstorm terminal

Go to File -> Settings -> Tools -> Terminal and change Shell path based on the the installed git version.

for 64bit:

"C:\Program Files\Git\bin\sh.exe" --login -i

for 32bit:

"C:\Program Files (x86)\Git\bin\sh.exe" --login -i
@cfebs
cfebs / guide.md
Last active February 16, 2022 19:49
Ubuntu guest virtualbox on Windows 10 host with ssh port forwarding

If you want:

  • a Linux guest runnning on a Windows host
  • the ability to ssh to the guest from the Windows host
  • the ability to ssh to the guest from another machine on your home network

About 90% of this comes from: https://gist.github.com/pjdietz/5768124 just with a few fixes for the host only network

Setup

1 Create a host only network in the Virtualbox GUI