Skip to content

Instantly share code, notes, and snippets.

View crosalot's full-sized avatar

Panudate Vasinwattana crosalot

View GitHub Profile
@crosalot
crosalot / apitel.sender.html
Created March 18, 2021 04:01
Send multiple SMS of APITEL by simple HTML form and javascript (no server side required)
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
@crosalot
crosalot / parse_location.py
Created December 7, 2020 10:19
Parse Thailand Location (Tambon)
thailand_postcodes = [
u'พระบรมมหาราชวัง พระนคร กรุงเทพมหานคร 10200',
u'วังบูรพาภิรมย์ พระนคร กรุงเทพมหานคร 10200',
u'วัดราชบพิธ พระนคร กรุงเทพมหานคร 10200',
u'สำราญราษฎร์ พระนคร กรุงเทพมหานคร 10200',
u'ศาลเจ้าพ่อเสือ พระนคร กรุงเทพมหานคร 10200',
u'เสาชิงช้า พระนคร กรุงเทพมหานคร 10200',
u'บวรนิเวศ พระนคร กรุงเทพมหานคร 10200',
u'ตลาดยอด พระนคร กรุงเทพมหานคร 10200',
u'ชนะสงคราม พระนคร กรุงเทพมหานคร 10200',
<!DOCTYPE html>
<html>
<head>
<title>100 Taejai</title>
<style type="text/css">
.hidden {
display: none;
}
@crosalot
crosalot / testUnderstandRaceCondition.go
Created September 22, 2016 07:01
Understand Race Condition with Go
package main
import (
"fmt"
"time"
"sync/atomic"
)
var start time.Time
'use strict';
angular
.module('odmbase')
.controller('SocialFeedCtrl', ['$scope', '$window', '$http', '$timeout', 'Auth', 'CommonGoal', 'Update', 'User', SocialFeedCtrl]);
function SocialFeedCtrl ($scope, $window, $http, $timeout, Auth, CommonGoal, Update, User) {
<?php
function relative_to_absolute ($text) {
$lang = language_default();
global $base_path;
$text = preg_replace(
'/(src|href)=(\'|")' . preg_quote($base_path, '/') . '/',
'$1=$2'. url('<front>', array('absolute' => TRUE, 'language' => $lang)),
@crosalot
crosalot / box top and bottom with table style
Created February 19, 2014 07:01
CSS create sidebar and content and in sidebar box top and bottom with table style
<style>
.wrapper {
height: 100%;
position: relative;
}
.sidebar {
width: 100px;
float: left;
height: 100%;
position: absolute;
<!DOCTYPE html>
<html>
<head>
<title>SUbmit form</title>
</head>
<body>
<script type="text/javascript">var popup_submitted=false;</script>
<iframe name="hidden_iframe" id="hidden_iframe" style="display: none;"
onload="if(popup_submitted) {window.location=window.location;}"></iframe>
{% spaceless %}
{% load common_tags %}
{% load comment_tags %}
{% load i18n %}
<{% if tag %}{{ tag }}{% else %}li{% endif %} class="notification-item service-{{ notification.service|to_ }}{% if notification.status == notification.STATUS_NEW or notification.status == notification.STATUS_NEW2 %} notification-new{% endif %} clearfix">
{% if notification.service == 'Relationship' %}
{{ notification.src_user|fullnamelink }} {% trans 'followed you' %} {% if display_time %}<span class="noti-time">{{ notification.created|date:'f a' }}</span>{% endif %}<span></span>
@crosalot
crosalot / gist:3775229
Created September 24, 2012 09:56
MTD notify template
{% load common_tags %}
{% load i18n %}
<li class="notification-item service-{{ notification.service|to_ }}{% if notification.status == notification.STATUS_NEW %} notification-new{% endif %} clearfix">
{% if notification.service == 'Relationship' %}
{{ notification.src_user|fullnamelink }} {% trans 'followed you' %} <span class="noti-time">{{ notification.created|date:'f a' }}</span>
{% elif notification.service == 'Goal' %}