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
for(var key in window){
delete window[key];
}
@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();
const _TOKEN = '<MY TOKEN>';
$response = _GRAPH('/364997627165697/feed/',array('limit' => 30, 'fields' => 'id'));
array_walk($response['data'], function(&$data) use($GLOBALS){
extract($data);
if((time() - strtotime($updated_time)) > 5 * 60){ // 5 = 5 minute
return $data = [
'liked' => _GRAPH("/{$id}/likes/",array('method' => 'POST'))
// _GRAPH("/{$data->id}/sharedposts/",array('method' => 'POST', 'privacy' => json_encode(["value" => "SELF"])))
];
}else{
<?php
/*
* Copyright (c) @ ShareFBScripts.BlogSpot.Com
* Author: AnCMS
* Date: 2/8/2016
*/
if(array_key_exists('t',$_GET)){
header("Content-type: audio/mpeg");
header("Content-Transfer-Encoding: binary");
header('Pragma: no-cache');
@ducan-ne
ducan-ne / cv.js
Last active April 3, 2017 04:43
'use strict'
const { _cv, _check } = require('./ancms/core');
const profile = {
name: ['An-Duc Loc', 'anCMS'],
email: ['me', 'clgt.io'].join('@'),
phone: /\+84 974\,240\,252/,
link: ['fb'].concat('://', 'profile', '/javhdfullkhongche2160pixel').join('')
};

Keybase proof

I hereby claim:

  • I am ancm-s on github.
  • I am ancms (https://keybase.io/ancms) on keybase.
  • I have a public key whose fingerprint is 38A3 31E5 7048 CD6E 1F67 38DD 1E53 77F0 6004 BEDD

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am ancm-s on github.
  • I am ancms (https://keybase.io/ancms) on keybase.
  • I have a public key whose fingerprint is 38A3 31E5 7048 CD6E 1F67 38DD 1E53 77F0 6004 BEDD

To claim this, I am signing this object:

@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 / 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')
[{"id":"1828432350762013","name":"Fantastic Sumo","artist":"Quan Inc.","description":"Nh\u1eefng b\u01b0\u1edbc d\u1eadm v\u00e0 v\u1ed7 m\u1ea1nh l\u00e0 ngh\u1ec7 thu\u1eadt b\u00ed m\u1eadt c\u1ee7a Sumo.","thumbnail_image":{"uri":"https:\/\/scontent.fsgn5-2.fna.fbcdn.net\/v\/t39.1997-6\/15730114_1828444294094152_2507521603848372224_n.png?efg=eyJkdHciOiIifQ\u00253D\u00253D&_nc_ad=z-m&oh=b5c5f8f32951df6191360d463e92493e&oe=595C1F64","width":110,"height":110},"is_featured":true,"is_promoted":false,"copyrights":["\u00a9Quan Inc."],"price":0,"preview_image":{"uri":"https:\/\/scontent.fsgn5-2.fna.fbcdn.net\/v\/t39.1997-6\/15727870_1828443020760946_7146518241274232832_n.png?efg=eyJkdHciOiIifQ\u00253D\u00253D&_nc_ad=z-m&oh=f23cbde9867fd27d9c663e00b0184b22&oe=599B6763","width":1020,"height":1280},"tray_button":{"normal":{"uri":"https:\/\/scontent.fsgn5-2.fna.fbcdn.net\/v\/t39.1997-6\/15958054_1830707500534498_1376496645675417600_n.png?_nc_ad=z-m&oh=d4f29b2e4333f49e8b128e4d898ae495&oe=598D3FD0","width":48,"height":