Skip to content

Instantly share code, notes, and snippets.

View ducan-ne's full-sized avatar
🏠
Working from home

Đức An ducan-ne

🏠
Working from home
View GitHub Profile
@ducan-ne
ducan-ne / ohai.gif
Created August 12, 2019 22:07 — forked from Qix-/ohai.gif
ohaider
ohai.gif
@ducan-ne
ducan-ne / encrypt_decrypt.js
Created March 10, 2017 17:14 — forked from csanz/encrypt_decrypt.js
Simple String Encryption & Decryption with Node.js
function encrypt(text){
var cipher = crypto.createCipher('aes-256-cbc','d6F3Efeq')
var crypted = cipher.update(text,'utf8','hex')
crypted += cipher.final('hex');
return crypted;
}
function decrypt(text){
var decipher = crypto.createDecipher('aes-256-cbc','d6F3Efeq')
var dec = decipher.update(text,'hex','utf8')
@ducan-ne
ducan-ne / slugify.js
Created March 7, 2017 14:08 — forked from mathewbyrne/slugify.js
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@ducan-ne
ducan-ne / HelloWorld.java
Created December 13, 2016 15:01 — forked from lolzballs/HelloWorld.java
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();