Skip to content

Instantly share code, notes, and snippets.

View duyet's full-sized avatar

duyet duyet

View GitHub Profile
@duyet
duyet / demo
Created February 10, 2014 14:10
Demo
sdfsfsdfsdfsdfsdfsdf
@duyet
duyet / reset.css
Created February 13, 2014 11:22
reset.css
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
@duyet
duyet / html5shiv
Created February 14, 2014 04:05
HTML5shiv and Response.js for IE
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
@duyet
duyet / md5.js
Created February 14, 2014 05:00
MD5 with js
function md5(str) {
// discuss at: http://phpjs.org/functions/md5/
// original by: Webtoolkit.info (http://www.webtoolkit.info/)
// improved by: Michael White (http://getsprink.com)
// improved by: Jack
// improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// input by: Brett Zamir (http://brett-zamir.me)
// bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// depends on: utf8_encode
// example 1: md5('Kevin van Zonneveld');
@duyet
duyet / md5.js
Created February 14, 2014 05:43
var md5=(function(){function e(e,t){var o=e[0],u=e[1],a=e[2],f=e[3];o=n(o,u,a,f,t[0],7,-680876936);f=n(f,o,u,a,t[1],
12,-389564586);a=n(a,f,o,u,t[2],17,606105819);u=n(u,a,f,o,t[3],22,-1044525330);o=n(o,u,a,f,t[4],7,-176418897);f=n(f,o,u,a,t[5],
12,1200080426);a=n(a,f,o,u,t[6],17,-1473231341);u=n(u,a,f,o,t[7],22,-45705983);o=n(o,u,a,f,t[8],7,1770035416);f=n(f,o,u,a,t[9],
12,-1958414417);a=n(a,f,o,u,t[10],17,-42063);u=n(u,a,f,o,t[11],22,-1990404162);o=n(o,u,a,f,t[12],7,1804603682);f=n(f,o,u,a,t[13],
12,-40341101);a=n(a,f,o,u,t[14],17,-1502002290);u=n(u,a,f,o,t[15],22,1236535329);o=r(o,u,a,f,t[1],5,-165796510);f=r(f,o,u,a,t[6],
9,-1069501632);a=r(a,f,o,u,t[11],14,643717713);u=r(u,a,f,o,t[0],20,-373897302);o=r(o,u,a,f,t[5],5,-701558691);f=r(f,o,u,a,t[10],
9,38016083);a=r(a,f,o,u,t[15],14,-660478335);u=r(u,a,f,o,t[4],20,-405537848);o=r(o,u,a,f,t[9],5,568446438);f=r(f,o,u,a,t[14],
9,-1019803690);a=r(a,f,o,u,t[3],14,-187363961);u=r(u,a,f,o,t[8],20,1163531501);o=r(o,u,a,f,t[13],5,-1444681467);f=r(f,o,u,a,t[2],
9,-514
@duyet
duyet / Phan-so.cpp
Last active December 3, 2021 02:13
Xây dựng 1 chương trình nhập 1 mảng phân số Tính TBC các phân số trong mảng , tìm phân số bé nhất trong mảng , xắp xếp mảng phân số theo thứ tự giảm dần về tử số ...
#include <stdio.h>
#include <stdlib.h>
typedef struct {
int tuSo, mauSo;
} frac;
int UCLN(int a, int b) {
while (a != b) {
@duyet
duyet / hoan_vi_su_dung_xor
Created February 25, 2014 11:18
Hoán vị 2 biến không sử dụng biến tạm.
Bạn @Phuc-Daik viết hơi khó hiểu.
a ^= b ^= a ^= b mình có thể viết lại thành
a = a ^ b;
b = b ^ a;
a = a ^ b;
^ ở đây là phép XOR.
@duyet
duyet / lineCodeCouter.php
Created March 23, 2014 05:12
Get line of code for project
<?php
/**
* Pack of ypCore System
* Code by LvDuit
* (c) 2014
* Contact: lvduit08@gmail.com
*/
error_reporting(0);
class lineCount {
#include <stdio.h>
int main()
{
int day, month, max_day;
do {
printf("Nhap ngay, thang: ");
scanf("%d%d", &day, &month);
if (month < 0 || month > 12) {
#include <iostream>
using namespace std;
typedef enum {
tangDan, giamDan
} typeSort;
class vector {
private: