Skip to content

Instantly share code, notes, and snippets.

/* To avoid mixing em and rem units during compilation */
.select2-container--bootstrap {
display: block;
/*------------------------------------* #COMMON STYLES
\*------------------------------------*/
/**
* Search field in the Select2 dropdown.
*/
/**
@Kryptonit3-zz
Kryptonit3-zz / .gitignore
Last active July 13, 2018 18:15
Lightweight image cropping with jQuery
# Ignore everything in this directory
*
# Except this file
!.gitignore
@mloberg
mloberg / watermark.html
Created June 23, 2011 18:40
Watermark PHP
<img src="watermark.php?watermark=watermark.png&src=test.jpg" />
@bocharsky-bw
bocharsky-bw / hgfs-shared-folder-permissions
Created July 5, 2014 11:00
Permissions on Shared Folders on Ubuntu
http://viraj-workstuff.blogspot.com/2013/07/vmware-fusion-permissions-on-shared.html
VMware Fusion - Permissions on Shared Folders on Ubuntu
VMware Fusion provides a nice functionality of sharing folder from host (Mac OSX) to guest (Ubuntu). But then, it seems they are more focused on windows guests, because they screwup on file permissions of shared folders.
"ls -al /mnt/hgfs" will show 501 dialout as user and group, which is sure to cause permission issues on linux guest.
Update: Found a more persistent alternative
1. sudo vim /etc/vmware-tools/services.sh
2. Search for 'vmhgfs_mnt="/mnt/hgfs"'. After this line add: 'vmuser=${VMWARE_MNT_USER:-root}'
@jacobtwlee
jacobtwlee / UploadSupportDetection.js
Last active July 16, 2019 13:59
Upload support detection
function isUploadSupported() {
if (navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/)) {
return false;
}
var elem = document.createElement('input');
elem.type = 'file';
return !elem.disabled;
};
@rgl
rgl / create-certificates.sh
Last active February 7, 2020 15:51
create test CA and server certificates with openssl
#!/bin/bash
set -eux
ca_subject='/CN=Test CA'
domains=(
'a.example.com'
'b.example.com'
)
# create the CA keypair and a self-signed certificate.
@galaczi
galaczi / App.vue
Last active March 11, 2020 10:02
<template>
<div id="app">
<header>
<h1>Buy this</h1>
<div class="cart" ref="cart">Cart</div>
</header>
<main>
<div class="item">
<h2>Item01</h2>
@miguelramos
miguelramos / PHP-ELEMENT-Search.php
Created March 6, 2012 23:31
PHP: Search element in array recursive
<?php
/**
* Function to search for key/value in recursive mode. If last arg is true
* it returns it's value or key. By default give true or false if key/value have been found.
*
* @param array $array Array to search
* @param string $search What to search
* @param string $mode Mode search for value or key
* @param boolean $return Return value or key
@taotao
taotao / Debian_Mail_Server_with_Anti-Virus.md
Last active January 13, 2021 12:50
Debian Exim4 mail server with Clamav support.

Environment

  • Debian: Jessie
  • Mail Server: Exim
  • Anti-Virus: Clamav

Install packages

  1. apt-get install clamav clamav-daemon exim4-daemon-heavy

Configuration of Clamav

  1. Modify /etc/clamav/clamd.conf
@elena-kolevska
elena-kolevska / validators.php
Last active June 24, 2021 14:44
Custom alphabetic validator that allows spaces
<?php
/* app/validators.php */
Validator::extend('alpha_spaces', function($attribute, $value)
{
return preg_match('/^[\pL\s]+$/u', $value);
});
/*