Skip to content

Instantly share code, notes, and snippets.

View kulesa's full-sized avatar

Alexey Kuleshov kulesa

  • Limassol, Cyprus
View GitHub Profile
@keeth
keeth / api.tf
Last active January 13, 2021 14:34
Apex + Terraform + AWS Lambda + API Gateway + JSON Encoded Errors + CORS
resource "aws_api_gateway_rest_api" "myApi" {
name = "myApi-${var.env}"
description = "My awesome API (${var.env} environment)"
}
resource "aws_api_gateway_deployment" "myApi" {
depends_on = [
"aws_api_gateway_integration.myApi_myEndpoint_post",
"aws_api_gateway_integration_response.myApi_myEndpoint_post",
"aws_api_gateway_integration_response.myApi_myEndpoint_post_400",
var Dialog = React.createClass({
render: function() {
// 1) render nothing, this way the DOM diff will never try to do
// anything to it again, and we get a node to mess with
return React.DOM.div();
},
componentDidMount: function() {
// 2) do DOM lib stuff
this.node = this.getDOMNode();
@jonstokes
jonstokes / poltergeist.rb
Created July 13, 2014 23:33
Monkey patching poltergeist for use with JRuby 1.7.11
require "capybara"
require "capybara/poltergeist"
require "capybara/poltergeist/utility"
module Capybara::Poltergeist
Client.class_eval do
def start
@pid = Process.spawn(*command.map(&:to_s), pgroup: true)
ObjectSpace.define_finalizer(self, self.class.process_killer(@pid))
end
@allgress
allgress / reagent_datascript.cljs
Last active February 16, 2023 21:16
Test use of DataScript for state management of Reagent views.
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))
@ptaoussanis
ptaoussanis / reagent-component.cljs
Created February 3, 2014 10:49
Reagent component util
(defn component
"Experimental! A Reagent 'component' is a (fn [& [props children this]]) that:
* May have special metadata for React lifecycle methods.
* Returns either Hiccup data, or a nested (usu. post-setup) component[1].
This util makes writing Reagent components a little more convenient:
(component
:render (fn [node_ & cmpt-args]) -> Hiccup data, or nested component[1].
;; Additional methods optional:
:did-mount (fn [node])
@insin
insin / BootstrapModalMixin.js
Last active February 5, 2021 07:47
A Bootstrap (3) modal mixin for React / MIT License
/** @jsx React.DOM */
var BootstrapModalMixin = function() {
var handlerProps =
['handleShow', 'handleShown', 'handleHide', 'handleHidden']
var bsModalEvents = {
handleShow: 'show.bs.modal'
, handleShown: 'shown.bs.modal'
, handleHide: 'hide.bs.modal'
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@madrobby
madrobby / i18n.coffee
Created November 14, 2011 15:45
Backbone i18n with CoffeeScript
# before this file is loaded, a locale should be set:
#
# In a browser environment, you can use:
# ```<script>__locale='en';</script>```
#
# In a server environment (specifically node.js):
# ```global.__locale = 'en';```
# normalize in-app locale string to "en" or "de-AT"
parts = @__locale.split('-')
@peterhost
peterhost / node_debian_init.sh
Created November 25, 2010 11:41
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#!/bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28