Skip to content

Instantly share code, notes, and snippets.

@anamolsoman
anamolsoman / Profilephotojs.vue
Created July 12, 2020 07:07
Image crop and upload
<script>
import { mapState } from 'vuex'
import axios from 'axios'
import VueCropper from 'vue-cropperjs'
import 'cropperjs/dist/cropper.css'
export default {
components: { VueCropper },
props: ['image_name'],
data() {
return {
@emir
emir / tax_validation.php
Last active March 12, 2025 19:51
PHP Vergi Numarası Doğrulama
<?php
/**
* This method logically validates Turkish VAT number
*
* @param string $taxNumber
* @return bool
*/
public function validateTaxNumber(string $taxNumber): bool
{
@nazywamsiepawel
nazywamsiepawel / UINavigationBarWithSubtitle.swift
Last active July 20, 2023 11:58
UINavigationBar with subtitle / swift
func setTitle(title:String, subtitle:String) -> UIView {
let titleLabel = UILabel(frame: CGRect(x:0, y:-5, width:0, height:0))
titleLabel.backgroundColor = UIColor.clear
titleLabel.textColor = UIColor.gray
titleLabel.font = UIFont.boldSystemFont(ofSize: 17)
titleLabel.text = title
titleLabel.sizeToFit()
<?php
class WP_HTML_Compression {
protected $compress_css = true;
protected $compress_js = true;
protected $info_comment = true;
protected $remove_comments = true;
protected $html;
public function __construct($html) {
if (!empty($html)) {
@mkdizajn
mkdizajn / function.php
Last active May 6, 2020 15:59
Wordpress Bootstrap 3 responsive images
<?php
//----------------------------------------------------------/
// responsive images [ 1) add img-responsive class 2) remove dimensions ]
//----------------------------------------------------------/
function bootstrap_responsive_images( $html ){
$classes = 'img-responsive'; // separated by spaces, e.g. 'img image-link'
// check if there are already classes assigned to the anchor
if ( preg_match('/<img.*? class="/', $html) ) {
@erickarbe
erickarbe / jquery.scroll-addClass.js
Last active December 11, 2015 05:38 — forked from danott/jquery.scroll-lock.js
Boom. I just modified this plugin to simply add a class to the body tag when the "lockElement" reaches your offset point. This makes using this plugin MUCH easier with responsive designs. Simply utilize it with your media queries.
(function($) {
var defaults = {};
$.fn.fixedscroll = function(opts) {
var options = $.extend(defaults, opts);
var el = $(this);