Skip to content

Instantly share code, notes, and snippets.

View byeblogs's full-sized avatar

Iam ByeBlog`s byeblogs

View GitHub Profile
@byeblogs
byeblogs / iDelegate.js
Last active August 29, 2015 14:18
Delegate / On Function
// Without Event Delegation
$('button').click(function() {
console.log('click this button')
});
$('body').click(function() {
$(this).append('<button>hello im new button</button>')
$('button').click(function(event) {
console.log('click this button')
});
});
@byeblogs
byeblogs / FileToByteArr.java
Last active May 25, 2021 11:43 — forked from dreamkidd/FileToByteArr.java
File To ByteArray in Java
package com.baimes.utils;
import java.io.*;
/**
* Created by Ds_Kidd on 2015/4/3 0003.
* 将文件转换为byte数组,一般用于图片,视屏,及音频
*/
public class FileToByteArr {
@byeblogs
byeblogs / SimpleServer Node-Js
Last active May 25, 2021 11:42
Simple Server NodeJS
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs"),
port = process.argv[2] || 3000,
mimeTypes = {
'asc' : 'text/plain',
'au' : 'audio/basic',
@byeblogs
byeblogs / Disable Button Until Text Field Is Fill !
Last active May 25, 2021 11:42
Disable Button Until Text Field Is Fill
$(function() {
$("#fullName").blur(function(){
if($(this).val() != ""){
$("#required_fullName").css("color", "green");
if($("#emailAddress").val() != '' && $("#phoneNumber").val() != ''){
$("#PaymentSwitch").attr("disabled", false);
} else {
$("#PaymentSwitch").attr("disabled", true);
}
@byeblogs
byeblogs / Join Multiples Table
Last active May 25, 2021 11:41
Join Multiple Tablet MySQL
SELECT DI.HB_NAME, D.DESTINATION_CODE, CI.COUNTRY_CODE
FROM DESTINATION_ID as DI
JOIN DESTINATION as D
ON D.DESTINATION_CODE = DI.DESTINATION_CODE
JOIN COUNTRY_ID as CI
ON CI.COUNTRY_CODE = D.COUNTRY_CODE
WHERE (CI.COUNTRY_CODE = 'ID')
@byeblogs
byeblogs / Using - Git.txt
Last active May 25, 2021 11:40
Set up Git Configuration
/* Set up Git Configuration */
git config --global user.email "you@yourdomain.com"
git config --global user.name "Your Name"
git config --global core.editor "vi"
git config --global color.ui true
@byeblogs
byeblogs / gist:95c70bf34ec541852741c773ffcc952b
Last active April 7, 2016 04:22
What Is Run / Directive / Config ! (Angular_JS)
/*
Source : http://jsfiddle.net/ysq3m/
<div ng-app="myApp" ng-controller="myCtrl">
<div test1 test2> </div>
</div>
*/
@byeblogs
byeblogs / gist:632be3593b9790e6e119e30b4d53a1b0
Last active April 7, 2016 04:20
What Is Factory ! (Angular_JS)
/*
source : http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
<div ng-controller="MyCtrl">
{{hellos}}
</div>
*/
@byeblogs
byeblogs / .bash_profile
Created April 12, 2016 03:39 — forked from stephenll/.bash_profile
.bash_profile file on Mac OS X
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases.
# Much of this was originally copied from:
# http://natelandau.com/my-mac-osx-bash_profile/
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
@byeblogs
byeblogs / Upload Image !
Last active May 25, 2021 11:45
Upload Images
$pathTo = "/Applications/XAMPP/xamppfiles/htdocs/zmg-development/upload_src/directory/";
$img_src = $_POST['img_src'];
$img_name = $_POST['img_name'];
$data = base64_decode(preg_replace('#^data:image/[^;]+;base64,#', '', $img_src));
$file = $pathTo . $img_name;
$success = file_put_contents($file, $data);