Skip to content

Instantly share code, notes, and snippets.

View Andrew8xx8's full-sized avatar

Andrew Kulakov Andrew8xx8

View GitHub Profile
@melekes
melekes / Makefile
Last active August 29, 2015 14:15
Makefile for erlang projects
.PHONY: all compile deps clean distclean test docs xref dialyzer \
cleanplt
REBAR = `which rebar || ./script/rebar`
all: deps compile
compile: deps
@$(REBAR) compile
@numbata
numbata / docker-run-ssh
Last active September 11, 2015 11:54
docker-compose patсh
#!/bin/bash
# cat /usr/local/bin/docker-run-ssh
# "docker run" with SSH Agent Forwarding for boot2docker
# QuickStart:
# 1. Download to ~/bin/docker-run-ssh and chmod +x it
# 2. docker-run-ssh [normal args to docker run...]
# Use a unique ssh socket name per-invocation of this script
@Andrew8xx8
Andrew8xx8 / vimtips
Created April 6, 2011 06:11
замена dos-овых концов строк (\r\n -> \n)
Если vim автоматически не распознал DOS line ends,
то в конце строк будут символы ^M.
Удалить их можно простой заменой:
:%s/^M//g
Символ ^M при этом вводится как Ctrl-V Ctrl-M.
@Andrew8xx8
Andrew8xx8 / templater.js
Created May 14, 2012 15:34
Basic JS templater
/*
Usage:
fetchTemplate('#hello_world', {
h: 'Hello',
w: 'world',
})
<!DOCTYPE HTML>
<html>
<body>
@mokevnin
mokevnin / playbook
Last active December 31, 2015 20:39
---
-
hosts: default
vars:
database:
password: my_secret_password
# server_name: "codebattle.me"
erlang:
directory: ~/.kerl/erlangs
@jcdavison
jcdavison / rails-react-relay-graphql-workshop.md
Last active March 20, 2018 18:58
Learn to use Rails with React - Relay - Graphql

Join me as I conduct a live tutorial walk through of how to use Facebook's GraphQl/Relay tools to conduct high performance client side cache management in the context of a Ruby on Rails server, React client side stuff(z) and a declarative, non-RESTful, api.

We will be using a live application, source code and tutorials that I've written.

Live Application Site

Source Code

@eventhough
eventhough / Uploader.jsx
Last active January 14, 2019 12:25
React component for handling S3 file upload
var React = require('react');
var Dropzone = require('react-dropzone');
var axios = require('axios');
exports = module.exports = React.createClass({
_onDrop: function (files) {
var file = files[0];
axios.get(ENDPOINT_TO_GET_SIGNED_URL, {
filename: file.name,
@dlutzy
dlutzy / gist:2469037
Created April 23, 2012 05:59
Multi VM Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# David Lutz's Multi VM Vagrantfile
# inspired from Mark Barger's https://gist.github.com/2404910
boxes = [
{ :name => :web, :role => 'web_dev', :ip => '192.168.33.1', :ssh_port => 2201, :http_fwd => 9980, :cpus =>4, :shares => true },
{ :name => :data, :role => 'data_dev', :ip => '192.168.33.2', :ssh_port => 2202, :mysql_fwd => 9936, :cpus =>4 },
{ :name => :railsapp, :role => 'railsapp_dev', :ip => '192.168.33.3', :ssh_port => 2203, :http_fwd => 9990, :cpus =>1}
]
@leotsem
leotsem / binary_image.html
Created May 7, 2011 14:33
Get binary image data from remote image
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Get binary image data from remote image</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
<script type="text/javascript">
$().ready(function(){
@jarrodirwin
jarrodirwin / storagePolyfill.js
Last active June 21, 2022 14:27 — forked from remy/gist:350433
LocalStorage/SessionStorage Polyfill with Safari Private Browsing support.
// Refer to https://gist.github.com/remy/350433
try {
// Test webstorage existence.
if (!window.localStorage || !window.sessionStorage) throw "exception";
// Test webstorage accessibility - Needed for Safari private browsing.
localStorage.setItem('storage_test', 1);
localStorage.removeItem('storage_test');
} catch(e) {
(function () {
var Storage = function (type) {