Skip to content

Instantly share code, notes, and snippets.

View thaiall's full-sized avatar

burin rujjanapan thaiall

View GitHub Profile
@thaiall
thaiall / myspotlight.bat
Created October 10, 2017 13:57
เล่าเรื่องการคัดลอกภาพ ใน Spotlight บน Windows 10 แชร์ไว้ที่ http://www.thaiall.com/assembly/batch.htm
rem myspotlight.bat
rem Test on Windows 10
rem This batch file can be saved in temporary folder.
rem === 1 : Copy section ===
mkdir %userprofile%\desktop\myspotlight
cd %localappdata%\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets
copy *.* %userprofile%\desktop\myspotlight
cd %userprofile%\desktop\myspotlight
rem === 2 : Delete small size section ===
FOR %%F IN (*.*) DO ( IF %%~zF LSS 100000 del %%F )
@thaiall
thaiall / menu01.php
Created September 28, 2017 06:23
bootstrap ก็ใช้งานได้ง่ายดี
<!DOCTYPE html>
<html lang="en">
<head><title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<style>
@media only screen and (max-width:600px) {
.m600 {visibility:hidden;display:none;height:0px;}
}
@thaiall
thaiall / twelvequestionfromc.c
Last active September 16, 2017 04:55
เพิ่มการ printf เพื่อตรวจสอบค่าใน loop ของ forแนวข้อสอบภาษา C จากน้องวงศ์ ผมเอาไปเล่าต่อที่ http://www.thaiall.com/blog/burin/8957/
#include <stdio.h> // for printf
#include <string.h> // for str..()
void main() {
int i=1, t1=0,t2=0,sum=0;
char s1[20]="petty",s2[20]="tiffies";
while(i<3) {
if(strcmp(s2,s1)>0)
strcat(s2,s1);
else if(strcmp(s1,s2)<0)
strcpy(s1,s2);
@thaiall
thaiall / mysqlworking.php
Created August 24, 2017 12:24
mysqlworking.php version 5.2560-08-19
<?php
ini_set('max_execution_time', 86400); // 86400 = 60 * 60 * 24 seconds = 24 Hours
/*
Script_name : mysqlworking.php
Source_code : http://www.thaiall.com/perlphpasp/source.pl?9116
Version 5.2560-08-19
###########################
Update Description
- เพิ่มลักษณะข้อมูลเป็น ตัวอักษรภาษาไทย และภาษาอังกฤษ เมื่อ insert 1000 ผ่าน การแปลงตัวอักษรด้วย iconv();
- เพิ่มการควบคุมตัวอักษรพิเศษ เปิดปิดการป้องกัน SQL Injection ผ่านตัวแปร $protect_sql_injection
@thaiall
thaiall / memmysql.php
Created August 23, 2017 09:17
memmysql.php version 1 on # ปรับปรุง : 2549-05-14 (แก้ไขเรื่องรหัส admin)
<?
# memmysql version 1.6a with mysql
# ปรับปรุง : 2549-05-14 (แก้ไขเรื่องรหัส admin)
# this program use table:mem in database:test
# ถ้าเข้า ?action=admin ครั้งแรกด้วยรหัสผ่านที่ถูกต้อง จะสร้างตารางอัตโนมัติ
#######################################
# SQL for duplicate checking
# select name,surname, count(name) as c from mem group by name,surname order by c desc;
#######################################
# Sample Website
@thaiall
thaiall / MainActivity.java
Created August 10, 2017 08:47
Android Studio : Layoutofnotification
package com.thaiall.www.layoutofnotification;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.support.v7.widget.Toolbar.LayoutParams;
import android.view.Menu;
import android.view.MenuItem;
@thaiall
thaiall / menu_main.xml
Created August 10, 2017 08:46
Android Studio : Layoutofnotification
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.thaiall.www.layoutofnotification.MainActivity">
<item
android:id="@+id/content1"
android:orderInCategory="100"
android:title="@string/content1"
app:showAsAction="never" />
<item
@thaiall
thaiall / activity_main.xml
Created August 10, 2017 08:44
Android Studio : Layoutofnotification
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.thaiall.www.layoutofnotification.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
@thaiall
thaiall / content1_main.xml
Created August 10, 2017 08:43
Android Studio : layoutofnotification
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.thaiall.www.layoutofnotification.MainActivity"
tools:showIn="@layout/activity_main">
@thaiall
thaiall / content2_main.xml
Created August 10, 2017 08:42
Android Studio : Layoutofnotification
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">