Skip to content

Instantly share code, notes, and snippets.

View kafkadev's full-sized avatar
🏠
Working from home

Gokhan Celik kafkadev

🏠
Working from home
View GitHub Profile
@kafkadev
kafkadev / new_gist_file_0
Created November 12, 2021 10:41 — forked from dewdad/new_gist_file_0
Overriding xmlhttprequest open to tamper with requests in JavaScript apps From http://stackoverflow.com/questions/7775767/javascript-overriding-xmlhttprequest-open
(function() {
var proxied = window.XMLHttpRequest.prototype.open;
window.XMLHttpRequest.prototype.open = function() {
console.log( arguments );
return proxied.apply(this, [].slice.call(arguments));
};
})();
/*
["POST", "/ajax/chat/buddy_list.php?__a=1", true]

CSS


What is CSS?

  • CSS stands for Cascading Style Sheet.
  • Styles define how to display HTML elements
  • Styles were added to HTML 4.0 to solve a problem
  • External Style Sheets can save a lot of work
  • External Style Sheets are stored in CSS files
******* tech dictionary : https://www.techopedia.com/dictionary
******* terminology (big data, AI, IOT,machine learning)
******* zend links
******* Software documentation
https://gist.github.com/armanhakimsagar/045a6a8063d7ade6e8315eaecb955e2a
@kafkadev
kafkadev / cryptojs_base64_encrypt_decrypt.js
Created October 20, 2021 19:40 — forked from joecliff/cryptojs_base64_encrypt_decrypt.js
An example of base64 usage in cryptojs
var CryptoJS = require("crypto-js");//replace thie with script tag in browser env
//encrypt
var rawStr = "hello world!";
var wordArray = CryptoJS.enc.Utf8.parse(rawStr);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
console.log('encrypted:', base64);
//decrypt
var parsedWordArray = CryptoJS.enc.Base64.parse(base64);
@kafkadev
kafkadev / user.js
Created February 14, 2021 15:01 — forked from EtienneR/user.js
XMLHttpRequest RESTful (GET, POST, PUT, DELETE)
// Get all users
var url = "http://localhost:8080/api/v1/users";
var xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.onload = function () {
var users = JSON.parse(xhr.responseText);
if (xhr.readyState == 4 && xhr.status == "200") {
console.table(users);
} else {
console.error(users);
@kafkadev
kafkadev / url_slug.php
Created March 23, 2020 06:50 — forked from sgmurphy/url_slug.php
URL Slugs in PHP (with UTF-8 and Transliteration Support)
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
@kafkadev
kafkadev / url_slug.js
Created March 23, 2020 06:49 — forked from sgmurphy/url_slug.js
URL Slugs in Javascript (with UTF-8 and Transliteration Support)
/**
* Create a web friendly URL slug from a string.
*
* Requires XRegExp (http://xregexp.com) with unicode add-ons for UTF-8 support.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
@kafkadev
kafkadev / image_xml_sitemap.php
Created March 19, 2020 19:23 — forked from gherkins/image_xml_sitemap.php
Create Google (Image) XML Sitemaps using PHP
header("Content-type: text/xml; charset=utf-8");
//create your XML document, using the namespaces
$urlset = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" /><!--?xml version="1.0" encoding="UTF-8"?-->');
//iterate over your sites pages or whatever you like
foreach (getMyPagesOrWhatEver() as $item):
//add the page URL to the XML urlset
@kafkadev
kafkadev / remove_duplicates.md
Created March 2, 2020 12:14 — forked from AnasAboreeda/remove_duplicates.md
How to remove duplicate lines in Visual Studio Code?
  1. Type in the search field: ^(.*)(\r?\n\1)+$
  2. type in the "replace with" field: $1
  3. Click "Replace All".