Skip to content

Instantly share code, notes, and snippets.

View ngnguyen1's full-sized avatar

Nga Nguyen ngnguyen1

  • FPT - Silicon Labs
  • Hà Nội
  • 10:11 (UTC +07:00)
  • LinkedIn in/nga-nguyen
View GitHub Profile
@ngnguyen1
ngnguyen1 / MTran.java
Created April 12, 2012 05:06
Ma Trận
/******************************
Java Programing Language
Author: nduy.nga
******************************/
package mTran;
//import java.;
public class MaTran
{
@ngnguyen1
ngnguyen1 / Main.java
Created April 12, 2012 10:05
Qly Sinh Vien
package qlysv;
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int n,a=0,b=0,c=0;
@ngnguyen1
ngnguyen1 / .vimrc
Created April 16, 2012 04:14
Vim Config
if has("syntax")
syntax on
endif
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
au BufWritePost *.sh !chmod +x %
au BufWritePost *.py !chmod +x %
endif
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
/*+--------------------------+
| Java Programing Language.|
| Author: nduy.nga. |
| ThaiNguyen University. |
+--------------------------+*/
package DS;
import java.util.Scanner;
public class DaySo
{
@ngnguyen1
ngnguyen1 / starup
Created May 24, 2012 12:41
startup-fluxbox
#!/bin/sh
#
# fluxbox startup-script:
#
# Lines starting with a '#' are ignored.
# Change your keymap:
xmodmap "$HOME/.Xmodmap"
# Applications you want to run with fluxbox.
! Filename: .Xmodmap
! Description: map key Ctr <-> Alt; Esc <-> Caps_Lock;
! Copy Right - 2012: [email protected]
remove control = Control_L
remove mod1 = Alt_L
remove mod1 = Meta_L
keysym Control_L = Meta_L
keysym Control_L = Alt_L
keysym Alt_L = Control_L
- create new repository named repositoryname
- Then, on client, create new forder named repositoryname
- move to the folder and initialize git by command: git init
- create new file README
- add new file or folder by git add foldername(filename)
- git commit -m 'The first commit' to comment for file or folder
- create new connection to git server by command: "git remote add connection_name https://github.com/username/repositoryname.git" or [email protected]:username/repositoryname.git
- then push on git server by command: git push -u connection_name master
- if get error Permission denied(publickey), you can:
- check that you are connecting to correct server by command: ssh -vT [email protected]
@ngnguyen1
ngnguyen1 / config
Created August 21, 2012 11:47
My .config of ncmpcpp
mpd_music_dir = "/home/anony/music"
user_interface = "alternative" (classic/alternative)
song_columns_list_format = "(22)[blue]{a} (7)[red]{n} (30)[white]{t} (29)[cyan]{b} (5)[blue]{y} (7)[white]{l}"
playlist_disable_highlight_delay = "0"
song_list_format = "{$8(%l)$9 }{%a - }{%t}|{$8%f$9}"
song_library_format = "{%n_}{%t}|{%f}"
media_library_album_format = "{(%y) }%b"
tag_editor_album_format = "{(%y) }%b"
browser_playlist_prefix = "$7playlist$9 "
selected_item_prefix = "$8"
@ngnguyen1
ngnguyen1 / text
Created December 9, 2012 03:51
hook-java.el
(defun java-class ()
"Generate a skeleton source for a Java class."
(interactive)
(setq name (read-from-minibuffer "Class name: " nil nil nil nil nil nil))
(setq pck (read-from-minibuffer "Package: " nil nil nil nil nil nil))
(setq exts (read-from-minibuffer "Extends: " "extends " nil nil nil nil nil))
(setq impl (read-from-minibuffer "Implements: " "implements " nil nil nil nil nil))
(insert (format "package %s;\n" pck))
(insert "\n")
(insert "/**\n")
@ngnguyen1
ngnguyen1 / 6.cs
Last active December 16, 2015 22:39
Kiểm tra số nguyên tố.
using System;
class Ngto {
public Boolean CheckNT (int n) {
bool t = false;
if (n > 1) {
t = true;
for (int i = 2; i <= Math.Sqrt(n); i++)
{
if (n % i == 0)