Skip to content

Instantly share code, notes, and snippets.

View goeko's full-sized avatar
🎯
Focusing

Gökhan Karaca goeko

🎯
Focusing
View GitHub Profile
@goeko
goeko / gist:4ca63cc464ce8ac4a7c62535f40ccef1
Created March 4, 2024 23:36
makeNonTransparentAreasWhite | makeNonTransparentWhiteAreasTransparent | getFirstpixelesColorAndMakeNonTransparentAreasTransparent
function makeNonTransparentAreasWhite(imageElement) {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
canvas.width = imageElement.width;
canvas.height = imageElement.height;
ctx.drawImage(imageElement, 0, 0);
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
const data = imageData.data;
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Vue.js Financial Calculator</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
</head>
<style>
::root {
--highlight-font-size: 1.2em;
javascript:(function() {
var searchEngines = [
{ url: 'https://duckduckgo.com/?q=', param: 'q' },
{ url: 'https://www.google.de/search?q=', param: 'q' },
{ url: 'https://www.bing.com/search?q=', param: 'q' },
{ url: 'https://search.yahoo.com/search?p=', param: 'p' },
{ url: 'https://www.ecosia.org/search?q=', param: 'q' },
{ url: 'https://www.qwant.com/?q=', param: 'q' },
{ url: 'https://www.startpage.com/do/dsearch?query=', param: 'query' },
{ url: 'https://metager.de/meta/meta.ger3?eingabe=', param: 'eingabe' },
javascript:(function() {
var tooltipElements = document.querySelectorAll('[data-tooltip-template="web.FieldTooltip"]');
if (!tooltipElements || tooltipElements.length === 0) {
alertTooltips('Die Tooltipelemente wurden nicht gefunden.');
return;
}
var alertsContainer = document.getElementById('alertTooltipsContainer');
if (!alertsContainer || alertsContainer === null) {
alertsContainer = document.createElement('div');
javascript:(function() {
var searchEngines = [
{ url: 'https://duckduckgo.com/?q=', param: 'q' },
{ url: 'https://www.google.de/search?q=', param: 'q' },
{ url: 'https://www.bing.com/search?q=', param: 'q' },
{ url: 'https://search.yahoo.com/search?p=', param: 'p' },
{ url: 'https://www.ecosia.org/search?q=', param: 'q' },
{ url: 'https://www.qwant.com/?q=', param: 'q' },
{ url: 'https://www.startpage.com/do/dsearch?query=', param: 'query' },
{ url: 'https://metager.de/meta/meta.ger3?eingabe=', param: 'eingabe' },
/**
* Setup images sprite having high resolution variant for retina displays.
*
* It will create class names for all available icons.
*
* This uses custom function to prefix selectors from array. To get it working you will need to include following snippet in your config.rb
*
* module Sass::Script::Functions
* def prefix_each(array, prefix)
* return Sass::Script::String.new array.to_a.map{|item| prefix.value + item.value}.join(", ")
@goeko
goeko / input.scss
Created June 15, 2012 19:52 — forked from twe4ked/input.scss
FREE! Sass (SCSS) mixin for including retina images (useful when developing for iOS).
@mixin background-image-retina($file, $type, $width, $height) {
background-image: url($file + '.' + $type);
@media (-webkit-min-device-pixel-ratio: 2) {
& {
background-image: url($file + '@2x.' + $type);
-webkit-background-size: $width $height;
}
}
}