Skip to content

Instantly share code, notes, and snippets.

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

muhammed burak şentürk meftunca

🏠
Working from home
  • A developer who suffers from the disease of selectivity in learning from unnecessary real-life experience.
  • İstanbul
  • 13:37 (UTC +03:00)
View GitHub Profile
@meftunca
meftunca / clearProjectBuildFolders.sh
Created January 7, 2020 21:13
Mac veya linux için npm ve react native(android, ios) proje sonrası gereksiz dosyaları(node_modules,**/build, Pods) temizleme kodu
find . -name "node_modules" -type d -prune -exec rm -rf '{}' + && find . -name "Pods" -type d -prune -exec rm -rf '{}' + && find . -name "build" -type d -prune -exec rm -rf '{}' +
@meftunca
meftunca / EventBase.js
Created January 7, 2020 18:29
EsNext event emitter class
class EventBase {
subscribers = new Map();
onceEvents = new Map();
listeners = new Map();
on(eventName, callback) {
this.subscribers.set(eventName, callback);
}
once(eventName, callback) {
@meftunca
meftunca / jsCalendarClass.js
Last active January 3, 2020 16:13
jsCalendarClass.js
/**
{
year:this.template.year,
longMonthNames:[],
shortMonthNames:[],
longDayNames:[],
shortDayNames:[],
monthFirstDay:[],
months:[
[
@meftunca
meftunca / iFetch.js
Created August 6, 2019 21:55
Fetch Api With Es6 Class
class fetchApi {
// method = "GET";
defaultConfig = {
method: "GET", // *GET, POST, PUT, DELETE, etc.
mode: "*same-origin", // no-cors, cors, *same-origin
cache: "no-cache", // *default, no-cache, reload, force-cache, only-if-cached
credentials: "*same-origin", // include, *same-origin, omit
headers: {
"Content-Type": "application/json",
Accept: "application/json"
export default listenerFunc => {
Object.defineProperty(window.globalStore, "onChangeListener", {
value: listenerFunc
});
};
@meftunca
meftunca / callClass.js
Last active July 7, 2019 12:57
js Class
class Basic {} // Basic Sınıfını oluşturalı...
const basicClass = new Basic();//Basic Sınıfını çağıralım...
<form action="path/to/server/script" method="post" id="my_form">
<label>Name</label>
<input type="text" name="name" />
<label>Email</label>
<input type="email" name="email" />
<label>Website</label>
<input type="url" name="website" />
<button type="submit" class="submit_button">Submit Form <button/>
</form>
@meftunca
meftunca / resp.php
Last active July 3, 2019 11:18
resp.php
<?php
$service_url = 'https://ronesis.com/API/api/v1/uye-bilgileri.php?uye_id=2087';
$curl = curl_init($service_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$curl_response = curl_exec($curl);
if ($curl_response === false) {
$info = curl_getinfo($curl);
curl_close($curl);
die('error occured during curl exec. Additioanl info: ' . var_export($info));
const camelize = camelize(str) => {
return str.replace(/\W+(.)/g, (match, chr) =>
{
return chr.toUpperCase();
});
};
console.log(camelize("javaScript-Exercises"));
console.log(camelize("JavaScript exercises"));
@meftunca
meftunca / uniqid.js
Created April 21, 2019 16:45
JS uniqid generator
export default (key = "key") => {
let ts = String(new Date().getTime()),
i = 0,
out = "";
for (i = 0; i < ts.length; i += 2) {
out += Number(ts.substr(i, 2)).toString(36);
}
return key + out;
};