Skip to content

Instantly share code, notes, and snippets.

View archangel-irk's full-sized avatar
:octocat:

Konstantin Melnikov archangel-irk

:octocat:
View GitHub Profile
@oukayuka
oukayuka / FlashMessage.tsx
Last active August 6, 2020 12:39
Recompose withStateHandlers with TypeScript
import * as React from 'react';
import { compose, lifecycle, pure, StateHandler, StateHandlerMap, withStateHandlers } from 'recompose';
import { Message, Transition } from 'semantic-ui-react';
import './FlashMessage.css';
export interface FlashMessageProps {
message: string;
isWarning?: boolean;
}
@kyoh86
kyoh86 / export-notes.applescript
Last active August 15, 2021 14:11
Export notes from Note.app to PDF files.
-- 対象のフォルダの一番上を選択している状態から始める
set targetFolder to "aaa"
tell application "Notes"
activate
repeat with theFolder in every folder
if name of theFolder = targetFolder then
repeat with theNote in every note of theFolder
tell application "System Events"
key code 126
import hoistStatics from 'hoist-non-react-statics';
import React from 'react';
/**
* Allows two animation frames to complete to allow other components to update
* and re-render before mounting and rendering an expensive `WrappedComponent`.
*/
export default function deferComponentRender(WrappedComponent) {
class DeferredRenderWrapper extends React.Component {
constructor(props, context) {
@stereokai
stereokai / gist:36dc0095b9d24ce93b045e2ddc60d7a0
Last active January 6, 2025 16:03
CSS rounded corners with gradient border
.rounded-corners-gradient-borders {
width: 300px;
height: 80px;
border: double 4px transparent;
border-radius: 80px;
background-image: linear-gradient(white, white), radial-gradient(circle at top left, #f00,#3020ff);
background-origin: border-box;
background-clip: padding-box, border-box;
}
@paulirish
paulirish / what-forces-layout.md
Last active April 7, 2025 08:15
What forces layout/reflow. The comprehensive list.

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.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@xjamundx
xjamundx / blog-webpack-2.md
Last active November 7, 2024 13:10
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

@rmnssnvsk
rmnssnvsk / structure-dir-linux.md
Created December 24, 2014 23:45
Структура директорий в ОС Linux

Структура директорий в ОС Linux

/

Корневой раздел.

/bin

В этом каталоге хранятся основные команды операционной системы, такие как команды оболочки и команды файловой системы (ls, cp и т.д.).

/boot

Здесь хранятся образы ядер Linux и менеджер загрузки: grub, lilo и т.д.

/dev

Директория содержит файлы устройств, подключенные к операционной системе. В Linux вообще всё рассматривается, как файл, даже различные устройства, такие как принтеры, жёсткие диски, сканеры и т.д. Для получения доступа к определённому устройству, необходимо чтобы существовал специальный файл. Аналогично устроено большинство UNIX-подобных операционных систем.

@jeffmo
jeffmo / gist:054df782c05639da2adb
Last active January 11, 2024 06:05
ES Class Property Declarations
@jimothyGator
jimothyGator / README.md
Last active December 20, 2024 09:08
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
/**
* Watcher leaks for jQuery
* RubaXa <[email protected]>
* MIT Licensed.
*
* API:
* $.leaks.get();
* $.leaks.watch();
* $.leaks.unwatch();
* $.leaks.remove();