Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Özkan ÖZSERT ozknozsrt

🎯
Focusing
View GitHub Profile
@ozknozsrt
ozknozsrt / selectpicker-collapsible.js
Created Jun 24, 2021
bootstrap-select (selectpicker) make collapsible with optgroup
View selectpicker-collapsible.js
// Selectpicker converts to collapsible when the inside has a optgroup
$('.selectpicker').on('shown.bs.select', function (e, clickedIndex, isSelected, previousValue) {
if ($(e.target).find("optgroup").length > 0) {
//.bootstrap-select .dropdown-menu .dropdown-header
$(e.target).closest(".bootstrap-select").find(".dropdown-menu .dropdown-header").click(function (e) {
e.stopImmediatePropagation();
var $this = $(this),
$thisOpt = $this.attr("class").split(" ")[1],
$opt = $this.siblings("li").not(".dropdown-header, .dropdown-divider");
@ozknozsrt
ozknozsrt / reduce.js
Created May 4, 2021
Group objects in Array using reduce
View reduce.js
let meetingOriginal = [{
id: 19,
datetime: '2019-01-02T13:28:03+05:30',
status: 'proposed',
createdBy: 'buyer',
buyerId: 2,
buyerFirstName: 'Demo',
buyerLastName: 'User',
buyerProfileUrl: null,
petId: 1,
@ozknozsrt
ozknozsrt / readme.md
Last active Sep 20, 2020
How To Github delete a commit
View readme.md

How To Github delete a commit

Source YouTube link

1- Clone the repo to your machine.

git clone your_repo_link

2- Find ID of the commit which comes just before the commit which you want to delete.

@ozknozsrt
ozknozsrt / README.md
Last active Sep 5, 2020
Some of the resources discovered about React
View mail.html
<!-- SmtpJs -->
<script src="https://smtpjs.com/v3/smtp.js"></script>
<script>
$('.btn-submit').click(function () {
/*var maillist = [
'****@***.com',
'****@***.com',
];*/
View doviz.html
<div id="dovizkuru">
<div class="dolar">
<div>USD</div>
<div>Buying: <span class="buying"></span></div>
<div>Selling: <span class="selling"></span></div>
</div>
<div class="altin">
<div>Ounce Gold</div>
<div>Buying: <span class="buying"></span></div>
<div>Selling: <span class="selling"></span></div>
@ozknozsrt
ozknozsrt / app.js
Last active Apr 5, 2021 — forked from itzikbenh/app.js
WordPress API - how to fetch and paginate posts with Vue.js
View app.js
import Vue from 'vue';
import posts from './components/posts.vue';
window.axios = require('axios');
window.Vue = Vue;
Vue.component('posts', posts);
const app = new Vue({
el: '#app',
@ozknozsrt
ozknozsrt / slugify_tr.js
Created Sep 20, 2019 — forked from muratcorlu/slugify_tr.js
Javascript Türkçe karakter destekli slugify (url metni oluşturucu)
View slugify_tr.js
/**
* Metni url'de kullanılabilir hale çevirir. Boşluklar tireye çevrilir,
* alfanumerik olmayan katakterler silinir.
*
* Transform text into a URL path slug(with Turkish support).
* Spaces turned into dashes, remove non alnum
*
* @param string text
*/
slugify = function(text) {
@ozknozsrt
ozknozsrt / svg.js
Created Feb 12, 2019 — forked from Bloggerschmidt/svg.js
Replace all SVG images with inline SVG using jQuery
View svg.js
/*
* Replace all SVG images with inline SVG
*/
jQuery('img.svg').each(function(){
var $img = jQuery(this);
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
jQuery.get(imgURL, function(data) {
View index.js
var getUrl = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname + window.location.search;
$('#getUrl').val(getUrl);
/*-----------------*/
// Parse the URL
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);