This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from shapely.geometry import Point | |
from shapely.geometry.polygon import Polygon | |
# data trip of users | |
# id, driverId, userId, amount, rideType, latOrigin, longOrigin, latDestination, longDestination, distance, createdAt, finishedAt | |
trips = [ | |
[1,"b83c50be-4b17-405a-8885-f46b1cb12beb","0911d670-cb99-4000-9cae-c082c1c98c95", 12000, 1, -6.2812861, 107.0149711, 6.246310, 107.018128, 2.3, "2023-08-20 10:10:10", "2023-08-20 10:25:10"], | |
[2,"x123dda-4we7-ss5a-9985-xxeweb12beb","0911d670-cb99-4000-9cae-c082c1c98c95", 15000, 1, -6.2023535,106.8150157, -6.2273916,106.8043289, 1.5, "2023-08-20 11:10:10", "2023-08-20 11:45:10"], | |
[3,"d312fabd-2f65-493b-93d0-67a1a31d4e6e","0911d670-cb99-4000-9cae-c082c1c98c95", 35000, 2, -6.2273916,106.8043289, -6.2271669,106.7945101, 2.9, "2023-08-20 18:10:10", "2023-08-20 18:30:10"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://medium.com/google-cloud/yet-another-way-to-generate-fake-datasets-in-bigquery-93ee87c1008f | |
CREATE TEMP FUNCTION entity(seed INT64) | |
RETURNS STRUCT<transaction_id String, user_id Integer, transaction_date String, ledger_type String, points Integer, partner String, remarks String, country String> | |
LANGUAGE js | |
AS """ | |
var t = {}; | |
var items = [100,150,200,250,300,350,400] | |
var countries = ["sg", "id"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
truncate campaign restart identity cascade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @Title GetContestants | |
// @Description Get list contestant for specific campaign | |
// @Success 200 success | |
// @Param X-Tenant=>tenantID header string true "tenant id" | |
// @Param page query int 1 false "active page" | |
// @router /:campaignID/contestants [get] | |
func (c *AdminContestantController) GetContestants(page int, tenantID string, campaignID int) *jsonapi.JsonAPIResponse { | |
totalPage, err := c.contestantHandler.GetTotalPage(campaignID) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class AdjustTicketsTable extends Migration | |
{ | |
/** | |
* Run the migrations. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateTableUsers extends Migration | |
{ | |
/** | |
* Run the migrations. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FTP access parameters | |
$host = 'xxx'; | |
$usr = 'xxx'; | |
$pwd = 'xxx'; | |
// file to move: | |
// $local_file = 'D:/xampp/htdocs/absen_folder/log_script.txt'; | |
// $local_file = 'D:\xampp\htdocs\absen_folder\log_script.txt'; | |
$local_file = 'cek.txt'; | |
$ftp_path = 'derta.co.id/htdocs/tes_derta/'.date('Y-m-d').'/cek.txt'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 | |
$file = fopen('log_script.txt', 'a'); | |
fwrite($file, $error. "\n"); | |
fclose($file); | |
#2 | |
$file_log = 'log_script.txt'; | |
file_put_contents($file_log, $error."\n", FILE_APPEND | LOCK_EX); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#October 3, 2017 | |
#First activate pdo_odbc in your server | |
#extension=php_pdo_odbc.dll | |
#then | |
#odbc.defaultbinmode=1 | |
#odbc.defaultlrl=4096 | |
#odbc.max_links=-1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function round_up_to_nearest_n($int, $n) { | |
return ceil($int / $n) * $n; | |
} | |
//result will be 10100 | |
round_up_to_nearest(10001,100); | |
//result will be 100000 | |
round_up_to_nearest(85000,50000); |
NewerOlder