Skip to content

Instantly share code, notes, and snippets.

View Linrstudio's full-sized avatar
🌴
On vacation

xyz Linrstudio

🌴
On vacation
View GitHub Profile
@vladimirbrasil
vladimirbrasil / index.html
Created December 7, 2017 20:08
Vladimir Bergier Convert RGBA to RGB // source http://jsbin.com/qocixeh
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Convert RGBA to RGB">
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Vladimir Bergier</title>
<style>
div {
width: 100%;
@mlmmn
mlmmn / History|-106f3fe6|entries.json
Last active July 14, 2022 04:47
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/miloslaw.politowski/dev/olxeu-pwa/packages/core/config/moduleFederation/sharedLibraries.test.js","entries":[{"id":"I2jX.js","timestamp":1649672643237},{"id":"QD5D.js","timestamp":1649672723002},{"id":"0LjU.js","timestamp":1649927046401},{"id":"DmJh.js","timestamp":1649927453691},{"id":"T4f2.js","timestamp":1649927483075},{"id":"fvhg.js","source":"undoRedo.source","timestamp":1649927493567},{"id":"Xgn3.js","timestamp":1649927585064},{"id":"0ndm.js","timestamp":1649927595563},{"id":"GpZe.js","timestamp":1649927758053}]}
@Gaubee
Gaubee / PromisePool.js
Created October 29, 2017 02:35
JS实现+=/-=操作符号的重载
// __op_temp_null_: 说明缓存取中没有东西
Object.defineProperty(global, "__op_temp_null_", {
value: Symbol("Operators Object NULL")
});
const op_temp_key = Symbol("Operators Object TEMP");
Object.defineProperty(global, "__op_temp__", {
get() {
const res = this[op_temp_key];
// 取值后马上移除引用关系
this[op_temp_key] = global.__op_temp_null_;
@Gaubee
Gaubee / H5lock.md
Last active March 1, 2018 02:57
Pattern Lock Base on Canvas

How to use

const lock = new H5lock({
  width: number,
  height: number,
  container: Element|id,
  chooseType ?: 2|3|4|5, // default is 3: 3×3
  inputEnd(pwd){
    console.log('Pattern Lock Value Is:', pwd);
 }
@Gaubee
Gaubee / Capture DOM.MD
Last active March 1, 2018 02:58
Capture DOM
domToImg.dom = document.body;
domToImg.download(location.protocol + "//" + location.host + "/build/main.css");
@shelldandy
shelldandy / typekit.html
Last active April 27, 2018 15:25
Master Race Typekit Solution by Glen Maddern
<head>
<script>
if (window.localStorage && window.localStorage._tk_cache) {
document.documentElement.classList.add('wf-active');
var script = document.createElement('script');
script.innerHTML = localStorage._tk_cache + ";(function () {var timeout = setTimeout(function () {document.documentElement.classList.remove('wf-active');}, 300); Typekit.load({ async: false, active: function () { clearTimeout(timeout); }});})();";
document.head.appendChild(script);
}
window._tk_onload = function () {
var req = new XMLHttpRequest()
@shivendra14
shivendra14 / Illustrator_Scale_Artboard_and_Artwork.jsx
Last active December 13, 2024 23:47
Illustrator_Scale_Artboard_and_Artwork
#target Illustrator
var requiredABsize = 1700; //px
var activeDoc = app.activeDocument;
var abActive = activeDoc.artboards[ activeDoc.artboards.getActiveArtboardIndex() ];
var abProps = getArtboardBounds(abActive);
var scale = findRequiredScale(abProps);
if (scale > 1)
@maxivak
maxivak / __upload_file.md
Last active January 30, 2025 19:11
PHP upload file with curl (multipart/form-data)

We want to upload file to a server with POST HTTP request. We will use curl functions.


// data fields for POST request
$fields = array("f1"=>"value1", "another_field2"=>"anothervalue");

// files to upload
$filenames = array("/tmp/1.jpg", "/tmp/2.png");
@darrnshn
darrnshn / mozGetMatchedCSSRules.js
Last active July 16, 2024 02:29 — forked from ydaniv/mozGetMatchedCSSRules.js
A Blink only polyfill for Webkit's window.getMatchedCSSRules
// polyfill window.getMatchedCSSRules() in Chrome
if ( typeof window.getMatchedCSSRules !== 'function' ) {
var ELEMENT_RE = /[\w-]+/g,
ID_RE = /#[\w-]+/g,
CLASS_RE = /\.[\w-]+/g,
ATTR_RE = /\[[^\]]+\]/g,
// :not() pseudo-class does not add to specificity, but its content does as if it was outside it
PSEUDO_CLASSES_RE = /\:(?!not)[\w-]+(\(.*\))?/g,
PSEUDO_ELEMENTS_RE = /\:\:?(after|before|first-letter|first-line|selection)/g;
// convert an array-like object to array
@pindamonhangaba
pindamonhangaba / KVDropdown.js
Created July 19, 2017 19:00
Handsontable key-value renderer and editor
import React from 'react';
import Handsontable, {DropdownEditor} from 'handsontable';
import extend from 'lodash/extend';
const AutocompleteEditor = Handsontable.editors.DropdownEditor;
export function enhancerRenderer(func) {
return (...args) => {
args[1].innerHTML = ReactDOMServer.renderToString(func.apply(null, args));
return args[1]
}