Skip to content

Instantly share code, notes, and snippets.

View vanduc1102's full-sized avatar
🐛
💯 💯 💩 😆 🐢

Duke Nguyen vanduc1102

🐛
💯 💯 💩 😆 🐢
View GitHub Profile
@vanduc1102
vanduc1102 / FileReader.js
Last active August 29, 2015 14:21
FileReader HTML5 AngularJS
xComponent.factory("fileReader", ["$q", "$log", function ($q, $log) {
var onLoad = function (reader, deferred, scope) {
return function () {
scope.$apply(function () {
deferred.resolve(reader.result);
});
};
};
var onError = function (reader, deferred, scope) {
@vanduc1102
vanduc1102 / Media.java
Last active April 10, 2016 17:00
Java RESTeasy return PDF IMAGE file.
@Path("media")
@Stateless
public class MediaRestService {
private final static org.slf4j.Logger log = LoggerFactory.getLogger(MediaRestService.class);
@EJB
private ThumbnailServices thumbnailService;
@EJB
private DocumentServices docServices;
@vanduc1102
vanduc1102 / employee.json
Last active August 29, 2015 14:21
emplopyee.son
{"id":1568,"number":4324,"validFrom":"2015-05-21","civility":{"code":"M"},"title":{"code":"D"},"firstName":"?dfasdf","lastName":"AAAAAAAAAA","birthDate":"2015-05-04","sex":{"code":"INC"},"deathDate":"2015-05-12","identifiers":[{"id":2621,"value":"?dfasdfasd","validFrom":"2015-05-12","validTo":"2015-05-17","indentifierType":{"code":"NSS"}},{"id":2622,"value":"fasdfasdfasd","validFrom":"2015-05-12","validTo":"2015-05-29","indentifierType":{"code":"ABC"}},{"id":2623,"value":"fasdfasdfasdf","validFrom":"2015-05-11","validTo":"2015-05-30","indentifierType":{"code":"A"}}],"passports":[],"maritalStatus":{"code":"S"},"maritalStatusChangeDate":"2015-04-27","handicapDegree":23,"isSingleParent":false,"nationalities":[],"origins":[],"permitType":{"code":"L"},"permitNumber":"12","permitDeliveranceAuthority":"?dfasdfasdf","permitExpiryDate":"2015-05-20","correspondanceLanguage":{},"spokenLanguages":[],"socialNetworks":[],"phones":[{"id":5130,"value":"12341234","mediaType":{"code":"PH"}},{"id":5131,"value":"1234123","mediaT
@vanduc1102
vanduc1102 / Beans.xml
Created May 21, 2015 09:41
Using Inject JEE
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>
@vanduc1102
vanduc1102 / Sublime_Text3_Keys.txt
Created May 22, 2015 01:50
Sublime_Text3_Keys.txt
-- BEGIN LICENSE --
Andrew Weber
Single User License
EA7E-855605
813A03DD 5E4AD9E6 6C0EEB94 BC99798F
942194A6 02396E98 E62C9979 4BB979FE
91424C9D A45400BF F6747D88 2FB88078
90F5CC94 1CDC92DC 8457107A F151657B
1D22E383 A997F016 42397640 33F41CFC
E1D0AE85 A0BBD039 0E9C8D55 E1B89D5D
@vanduc1102
vanduc1102 / ngClass.html
Last active August 29, 2015 14:21
Use ngClass in HTML
<!-- with IF condition -->
<div id="application-manage-header" ng-class="isOrangeUser ? 'user-red' : 'user-orange' " >
</div>
<!-- other IF condition -->
<div id="application-manage-body" ng-class="{'hidden-footer': isHideFooter}">
</div>
@vanduc1102
vanduc1102 / https-jboss.xml
Created May 26, 2015 06:43
Https Jboss XML
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" redirect-port="8443"/>
<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true">
<ssl name="localhost-ssl" key-alias="aavn-ws-115" password="123456" certificate-key-file="${jboss.server.config.dir}/localhost.keystore" protocol="TLSv1"/>
</connector>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
</virtual-server>
</subsystem>
@vanduc1102
vanduc1102 / https-jboss.xml
Last active August 29, 2015 14:21
Jboss HTTPS Configuration.
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" redirect-port="8443"/>
<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true">
<ssl name="localhost-ssl" key-alias="aavn-ws-115" password="123456" certificate-key-file="${jboss.server.config.dir}/localhost.keystore" protocol="TLSv1"/>
</connector>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
</virtual-server>
</subsystem>
@vanduc1102
vanduc1102 / SQL.sql
Created May 28, 2015 04:20
SQL Server common command
update hrc.person set ldap_symbol = null
@vanduc1102
vanduc1102 / cutmovie.bat
Created May 30, 2015 05:05
Split mp4 file in Ubuntu
ffmpeg -ss 00:05:00 -t 00:16:00 -i largeFile.mp4 -acodec copy -vcodec copy smallFile.MP4