Skip to content

Instantly share code, notes, and snippets.

View yothin's full-sized avatar

Yothin Samrandee yothin

View GitHub Profile
KYCApiManager.init().requestProfileGetProfile(email: email, mobileNo: self.mobileNo ?? "", completion: { (status, response, message) in
KYCSDK.hideActivityIndicator()
if status {
if response?.resultData?.info?.redirectURL != nil, response?.resultData?.info?.redirectURL != "" {
// https://www.facebook.com/?resultCode=04&resultMessage=CLASSIFY_FAIL
var url:String = (response?.resultData?.info?.redirectURL)!
if self.resultCode != nil, self.resultCode != "", self.resultMessage != nil, self.resultMessage != "" {
self.resultMessage = self.resultMessage!.replacingOccurrences(of: " ", with: "_")
url = "\(url)/?resultCode=\(self.resultCode!)&resultMessage=\(self.resultMessage!)&transactionId=\(KYCSDK.configKYC.transactionId!)"
{
"data" : {
"campaignPackages" : [
{
"_id" : "5e46314169b3de663d4c6529",
"details" : [
{
"sub_th" : " Max Speed | FUP 10 Mbps",
"th" : "• เน็ต ",
"sub_en" : " Max Speed | FUP 10 Mbps",
.controller('AddQuestionCtrl', function($scope, $http, $base64){
$scope.save = function(){
console.log('SAVE');
var url = 'http://XXXXX/wp-json/wp/v2/posts';
var username = 'XXXX';
var psw2 = 'XXXXX';
$http.post(url, {question: $scope.question},{
headers:{
'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8',
<?php
include 'vendor/autoload.php';
include 'simple_html_dom.php';
include 'utility.php';
//include 'config.inc.php';
define('API_TOKEN', "abcdef123456789!@#$%^&*()_+");
use GuzzleHttp\Client;
{
"data": [
{
"name": "The Primary Football Field",
"id": "331783936911780"
},
{
"name": "The Primary Football Field",
"id": "921012131314995"
},
{
"data": [
{
"name": "Thammasat University (TU.C Rangsit)",
"id": "101595643245022"
},
{
"name": "The Primary Football Field",
"id": "331783936911780"
},
@yothin
yothin / gist:daef2f0e5a63a42846e8b6cfa6d09423
Created January 31, 2018 09:13
UILabel ที่รองรับการแสดง link
https://github.com/Krelborn/KILabel
https://github.com/TTTAttributedLabel/TTTAttributedLabel
https://github.com/zacwest/ZSWTappableLabel
https://github.com/NimbusKit/attributedlabel
https://github.com/ProjectDent/LinkLabel
https://github.com/psharanda/Atributika
PackageInfo info;
try {
info = getPackageManager().getPackageInfo("com.hackskill.giftreward", PackageManager.GET_SIGNATURES);
for (Signature signature : info.signatures) {
MessageDigest md;
md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
String something = new String(Base64.encode(md.digest(), 0));
//String something = new String(Base64.encodeBytes(md.digest()));
Log.d("hash key", something);
- (void)checkShopIsOpen {
NSDateFormatter *df = [NSDateFormatter new];
df.dateFormat = @"HH:mm:ss";
NSDate *openTime = [df dateFromString:_shop.open_time];
NSDate *closeTime = [df dateFromString:_shop.close_time];
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDateComponents *components = [calendar components:(NSCalendarUnitHour | NSCalendarUnitMinute) fromDate:openTime];
if ([product hasLimitDownload]) {
if ([product hasLimitByDate]) {
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"dd/MM/yy hh:mm"];
//[formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
//[formatter setCalendar:[NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian]];
//[formatter setLocale:[NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"]];