Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jeffisabelle on github.
  • I am muhammet (https://keybase.io/muhammet) on keybase.
  • I have a public key whose fingerprint is 1C15 1AFF 101C 1C89 1077 842F 21B1 FDB6 6702 9366

To claim this, I am signing this object:

@jeffisabelle
jeffisabelle / gist:15d5b0ef671a8d34a32b
Created October 21, 2014 21:14
highlight selected
function highlightSelected() {
var sel = window.getSelection();
var div = document.createElement("div");
div.className = "highlighted";
if (sel.rangeCount) {
var range = sel.getRangeAt(0).cloneRange();
try {
range.surroundContents(div);
@mixin vendor-prefix($name, $value) {
@each $vendor in ('-webkit-', '-moz-', '-ms-', '-o-', '') {
#{$vendor}#{$name}: #{$value};
}
}
/*
$deg stands for "5deg", "45deg" etc.
*/
@mixin rotate($deg) {
@jeffisabelle
jeffisabelle / cover image from image tag
Last active August 29, 2015 13:59
change img to div with background-image (for covered thumbnails)
$('img.tocover').each(function(i, elem) {
var img = $(elem);
var div = $("<div />").css({
"background": "url(" + img.attr("src") + ") no-repeat",
"background-size": "cover",
"width": "150px",
"height": "150px",
"margin": "5px"
})
@jeffisabelle
jeffisabelle / tureng translation
Last active October 10, 2015 16:58
translation from tureng
#!/bin/bash
url_encode() {
# http://www.commandlinefu.com/commands/view/4840/url-encode
# http://stackoverflow.com/questions/296536/urlencode-from-a-bash-script
echo -n "${@: -1}" | python2 -c "import urllib, sys; print urllib.quote(sys.stdin.readline())"
# echo "$@" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"'
}