Skip to content

Instantly share code, notes, and snippets.

View kreedz's full-sized avatar

Artur Tukaev kreedz

  • Russia, Ufa
View GitHub Profile
@rosskevin
rosskevin / hoc-template.tsx
Last active August 23, 2020 19:44
Typescript higher order component (hoc) template
/* variation on https://medium.com/@DanHomola/react-higher-order-components-in-typescript-made-simple-6f9b55691af1 */
import * as React from 'react'
import { wrapDisplayName } from 'recompose'
// Props you want the resulting component to take (besides the props of the wrapped component)
interface ExternalProps {}
// Props the HOC adds to the wrapped component
export interface InjectedProps {}
@bmag
bmag / .emacs
Created September 20, 2016 08:19
Emacs dotfile for loading an Emacs configuration based on EMACSDIR environment variable
;; load configuration from $EMACSDIR/init.el and set $EMACSDIR as
;; `user-emacs-directory'. if $EMACSDIR is not set, use `~/.emacs.d'.
(let* ((emacs-dir-env (getenv "EMACSDIR"))
(custom-emacs-dir (and emacs-dir-env
(file-name-as-directory emacs-dir-env))))
;; `user-emacs-directory' default value is emacs.d"
(when custom-emacs-dir
(setq user-emacs-directory custom-emacs-dir)))
(setq user-init-file (expand-file-name "init.el" user-emacs-directory))
@xyfeng
xyfeng / gif.py
Last active January 19, 2022 15:55
python script turn images into gif
# From https://github.com/wnyc/PIL/blob/master/Scripts/gifmaker.py
#
# The Python Imaging Library
# $Id$
#
# convert sequence format to GIF animation
#
# history:
# 97-01-03 fl created
#
@kentcdodds
kentcdodds / package-exact.js
Last active February 2, 2024 12:08
make your package.json dependencies be the exact version that's in your node_modules currently
/* jshint node:true */
/* eslint-env node */
/*
* This will look at the current version of all of your dependencies and update your package.json
* with the specific version that you currently have in node_modules. This will save you from the
* sadness that is: DEPENDENCY MANAGEMENT
*
* Place this file in a folder that's a a sibling to your package.json and node_modules
* Then simply run: node scripts/package-strict
@tnarihi
tnarihi / README.md
Last active January 7, 2022 05:16
Emacs 24.4 installation on Ubuntu 14.04 without sudo

Installing Emacs 24.4 on Ubuntu 14.04 without sudo privilege

Just run:

sh ./ubuntu14.04-emacs-24.4-install.sh

This will install ncurses which is dependency of emacs24.4. It may requires another dependencies depending on your environment. Note that configure options in emacs installation are for disabling GUI features.

@jbinfo
jbinfo / scrapy_csv_exporter.md
Last active March 7, 2022 05:49
How to create a Scrapy CSV Exporter with a custom delimiter and order fields

Create a scrapy exporter on the root of your scrapy project, we suppose the name of your project is my_project, we can name this exporter: my_project_csv_item_exporter.py

from scrapy.conf import settings
from scrapy.contrib.exporter import CsvItemExporter

class MyProjectCsvItemExporter(CsvItemExporter):

    def __init__(self, *args, **kwargs):
 delimiter = settings.get('CSV_DELIMITER', ',')
@cobyism
cobyism / gh-pages-deploy.md
Last active May 7, 2024 18:46
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@wontoncc
wontoncc / balloontip.py
Last active March 1, 2024 15:47
Balloon tip module, Python, using win32gui.
# -- coding: utf-8 --
from win32api import *
from win32gui import *
import win32con
import sys, os
import struct
import time
class WindowsBalloonTip: