Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

cy cycold

🏠
Working from home
  • ShenZhen, China
Block or report user

Report or block cycold

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cycold
cycold / sublime-text-scopes.md
Created Jul 7, 2019 — forked from J2TEAM/sublime-text-scopes.md
Sublime Text 2/3: Snippet scopes
View sublime-text-scopes.md

Here is a list of scopes to use in Sublime Text 2/3 snippets -

ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
@cycold
cycold / what-forces-layout.md
Created Jun 15, 2019 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@cycold
cycold / download-file.js
Created May 20, 2019 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
View download-file.js
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@cycold
cycold / js-crypto-libraries.md
Created Nov 28, 2018 — forked from jo/js-crypto-libraries.md
List of JavaScript Crypto libraries.
View js-crypto-libraries.md

JavaScript Crypto Libraries

I start with a list and plan to create a comparison table.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@cycold
cycold / remove_input_number_scroll.js
Created Aug 2, 2018 — forked from JaisonBrooks/remove_input_number_scroll.js
Disable Input[type=number] scroll action
View remove_input_number_scroll.js
// Disable Mouse scrolling
$('input[type=number]').on('mousewheel',function(e){ $(this).blur(); });
// Disable keyboard scrolling
$('input[type=number]').on('keydown',function(e) {
var key = e.charCode || e.keyCode;
// Disable Up and Down Arrows on Keyboard
if(key == 38 || key == 40 ) {
e.preventDefault();
} else {
return;
@cycold
cycold / vscode-custom-colors.json
Created Jun 14, 2018 — forked from rouzbeh84/vscode-custom-colors.json
quasi complete list of workspace customization options for vscode
View vscode-custom-colors.json
{
"workbench.colorCustomizations": {
"activityBar.background": "#00AA00",
"activityBar.background": "", // Activity Bar bgcolor
"activityBar.border": "", // Activity Bar border color with the sidebar
"activityBar.dropBackground": "", // Drag and drop feedback color for the Activity Bar items
"activityBar.foreground": "", // Activity bar fgcolor (i.e. used for the icons)
"activityBarBadge.background": "", // Activity notification badge bgcolor
"activityBarBadge.foreground": "", // Activity notification badge fgcolor
"badge.background": "", // Badge bgcolor
@cycold
cycold / cyc.itermcolors
Created Mar 18, 2018
iterm2 oh-my-zsh thems
View cyc.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.0</real>
View Effective_Engineer.md

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@cycold
cycold / codegolf.md
Created Sep 28, 2017 — forked from xem/codegolf.md
JS code golfing
View codegolf.md

codegolf JS

Mini projects by Maxime Euzière (xem), subzey, Martin Kleppe (aemkei), Mathieu Henri (p01), Litterallylara, Tommy Hodgins (innovati), Veu(beke), Anders Kaare, Keith Clark, Addy Osmani, bburky, rlauck, cmoreau, maettig, thiemowmde, ilesinge, adlq, solinca, xen_the,...

(For more info and other projects, visit http://xem.github.io)

(Official Slack room: http://jsgolf.club / join us on http://register.jsgolf.club)

@cycold
cycold / somehost.conf
Created Mar 20, 2017 — forked from tomkersten/somehost.conf
Nginx config with CORS headers added globally (for application w/ Basic Auth)
View somehost.conf
upstream your-app {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
server unix:/tmp/your_app.socket fail_timeout=0;
}
server {
listen 80;
You can’t perform that action at this time.