Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Bilal Ucar bilalucar

💭
I may be slow to respond.
Block or report user

Report or block bilalucar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bilalucar
bilalucar / Crop and Resize Images With This Simple jQuery Plugin
Created Jul 25, 2017
Crop and Resize Images With This Simple jQuery Plugin
View Crop and Resize Images With This Simple jQuery Plugin
$('#image').cropper({
aspectRatio: 16 / 9,
crop: function(e) {
// Output the result data for cropping image.
console.log(e.x);
console.log(e.y);
console.log(e.width);
console.log(e.height);
console.log(e.rotate);
console.log(e.scaleX);
View TypeIt
$('.type-it').typeIt({
strings: ['This is my string!']
});
View MediumLightbox
MediumLightbox('figure.zoom-effect');
View Don’t Go script
ontGo({
title: 'Alternative title text right here!',
faviconSrc: 'path/to/Alternative/favicon.ico',
timeout: 5000 //5 seconds
});
View Push.js
Push.create("Hello world!", {
body: "How's it hangin'?",
icon: 'icon.png',
timeout: 4000,
onClick: function () {
window.focus();
this.close();
}
});
View justContext.js
<ul class="jctx jctx-id-foo jctx-black jctx-black-shadow">
<li data-action="cut">Cut</li>
<li data-action="copy">Copy</li>
<li data-action="paste">Paste</li>
<hr>
<li data-action="new_pkg">New package</li>
<li data-action="new_cls">New class</li>
<li data-action="new_intf" class="disabled">New interface
(a disabled entry)</li>
</ul>
View İcoFont
i class="icofont icofont-castle"></i>
View Medium Menu -11
function onShareClick() {
window.open(`https://twitter.com/intent/tweet?text=${this.shareTxt}`);
this.remove();
document.getSelection().removeAllRanges()
}
View Medium Menu -10
var shareBtn = shareBox.querySelector('button');
shareBtn['shareTxt'] = txt;
shareBtn.addEventListener('mousedown', onShareClick, true);
View Medium Menu -9
var rect = range.getBoundingClientRect();
var shareBox = document.querySelector('#shareBox');
shareBox.style.top = `calc(${rect.top}px - 38px)`;
shareBox.style.left = `calc(${rect.left}px + calc(${rect.width}px / 2) - 30px)`;
You can’t perform that action at this time.