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 | |
$host = 'https://api.bnm.gov.my/public/exchange-rate'; | |
$header = 'Accept: application/vnd.BNM.API.v1+json'; | |
$from_currency = 'USD'; | |
$data = array( | |
'session' => "0900", | |
); |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'aws-sdk' | |
#creates an interface object to AWS S3 | |
AWS.config( :access_key_id => '' , :secret_access_key => '' ) | |
#creates an interface to the S3 | |
s3interface = AWS::S3.new | |
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
#!/usr/bin/env python | |
import socket | |
import select | |
import threading | |
HOST = '' | |
PORT = 50007 | |
# use https or socks5 and use the same protocol on pc | |
PROXYHOST = 'your proxy server' | |
PROXYPORT = 8080 |
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
package javaapplication1; | |
/** | |
* | |
* @author wanzu | |
*/ | |
public class JavaApplication1 extends Thread { | |
static int minimum_expenses = 0; |
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
function round(value, precision, mode) { | |
var m, f, isHalf, sgn; | |
precision |= 0; | |
m = Math.pow(10, precision); | |
value *= m; | |
sgn = (value > 0) | -(value < 0); | |
isHalf = value % 1 === 0.5 * sgn; | |
f = Math.floor(value); | |
if ( isHalf ) { |
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 | |
// https://github.com/giggsey/libphonenumber-for-php | |
// composer require giggsey/libphonenumber-for-php | |
require 'vendor/autoload.php'; | |
use libphonenumber\PhoneNumberUtil; | |
use libphonenumber\PhoneNumberType; | |
use libphonenumber\PhoneNumberFormat; | |
$phoneNumber = "0107989480"; | |
$phoneNumberUtil = PhoneNumberUtil::getInstance(); |
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
-- Run this to replace URLs in the database when moving a WordPress blog from one URL to another. | |
-- | |
-- Replace "wp_" with the table prefix if you have changed it. | |
-- | |
-- You may need to update other tables/columns as well - I normally use phpMyAdmin's database search tool to search for the old URL. | |
-- | |
-- Note: Don't replace the guid field if you're changing the URL of a live site, only if you're making a development site live.) | |
-- | |
-- Alternatively, use WP-CLI (http://wp-cli.org/) or WP Migrate DB (https://en-gb.wordpress.org/plugins/wp-migrate-db/) |
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 | |
// WordPress stores the site URL in the database by default (which I have never | |
// understood), and it's a pain to have to type out the UPDATE SQL or search in | |
// phpMyAdmin to change it. This is a simple way to put the URL into | |
// wp-config.php instead. | |
// Note that you will still need to update any URLs that appear in the content, | |
// especially when you copy a database from a development site to production: | |
// https://gist.github.com/davejamesmiller/a8733a3fbb17e0ff0fb5 |
NewerOlder