Skip to content

Instantly share code, notes, and snippets.

View barmgeat's full-sized avatar

Mustafa Hazim barmgeat

  • Berlin, Germany
View GitHub Profile
//create html element:
function eHtml(data) {
data.type ? e = $('<' + data.type + '>') : e = $('<div>');
if (data.class) {
e.addClass(data.class);
}
if (data.id) {
e.attr('id', data.id);
@barmgeat
barmgeat / php requests function.js
Last active October 25, 2019 15:04
note extension for sure html but for markup i make it js
public static function postRequest($url, $postData, $headers){
//init curl:
$ch = curl_init($url);
// Configuring curl options
$options = array(
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $postData,
CURLOPT_HTTPHEADER => $headers
);