Skip to content

Instantly share code, notes, and snippets.

View black-black-cat's full-sized avatar

bcatb black-black-cat

View GitHub Profile
@black-black-cat
black-black-cat / workbench.colorCustomizations.json
Last active December 3, 2020 05:36 — forked from jacklorusso/workbench.colorCustomizations.json
A list of all Visual Studio Code customizable colors, grouped by UI region. Copy and paste into User Settings (comments are allowed) to tweak an existing theme or work on your own.
"workbench.colorCustomizations": {
// Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast.
"contrastActiveBorder": "",
"contrastBorder": "",
// Base Colors
"focusBorder": "",
"foreground": "",
"widget.shadow": "",
"selection.background": "",
"descriptionForeground": "",
@black-black-cat
black-black-cat / README.md
Last active November 5, 2019 07:36 — forked from joyrexus/README.md
Drag rotation of a div

Demonstrating drag rotation of an element around its center point.

@black-black-cat
black-black-cat / Get week number
Last active January 30, 2019 08:13 — forked from IamSilviu/Get week number
JavaScript Get week number.
Date.prototype.getWeek = function () {
var onejan = new Date(this.getFullYear(), 0, 1);
var today = new Date(this.getFullYear(), this.getMonth(), this.getDate());
return Math.ceil((((today - onejan) / 86400000) + onejan.getDay() + 1) / 7);
};
var myDate = new Date("2001-02-02");
myDate.getWeek(); //=> 5
border-width: 0 0 1px
border-bottom-style: solid
border-bottom-color: #c8c7cc
/* :root.retina */
border-image-source: url("data:image/svg+xml;charset=utf-8,<svg height='1' width='1' xmlns='http://www.w3.org/2000/svg'><rect height='.5' width='1' y='.5' fill='%23c8c7cc'/></svg>")
border-image-slice: 0 0 1
@black-black-cat
black-black-cat / cryptojs_base64_encrypt_decrypt.js
Created August 31, 2016 06:15 — forked from joecliff/cryptojs_base64_encrypt_decrypt.js
An example of base64 usage in cryptojs
var CryptoJS = require("crypto-js");//replace thie with script tag in browser env
//encrypt
var rawStr = "hello world!";
var wordArray = CryptoJS.enc.Utf8.parse(rawStr);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
console.log('encrypted:', base64);
//decrypt
var parsedWordArray = CryptoJS.enc.Base64.parse(base64);
@black-black-cat
black-black-cat / duffs_device.js
Last active August 23, 2016 15:06 — forked from JamieMason/duffs_device.js
JavaScript Duff's Device 达夫设备
/**
* 1. Original JS Implementation by Jeff Greenberg 2/2001 - http://home.earthlink.net/~kendrasg/info/js_opt/
* 2. (fast duff's device) from an anonymous donor to Jeff Greenberg's site
* 3. (faster duff's defice) by Andrew King 8/2002 for WebSiteOptimization.com
* 4. bug fix (for iterations<8) by Andrew B. King April 12, 2003
*/
function duffsDevice (iterations) {
var testVal = 0,
n = iterations % 8;