Skip to content

Instantly share code, notes, and snippets.

@suciuvlad
suciuvlad / checklist.md
Created October 29, 2015 17:45 — forked from mzabriskie/checklist.md
Release Process
  1. npm test
  2. npm run build
  3. Update package.json & bower.json version
  4. Update Changelog.md
  5. git commit -am"Releasing x.x.x"
  6. git push
  7. git tag -a vx.x.x -m"version x.x.x"
  8. git push origin --tags
  9. npm publish ./
@suciuvlad
suciuvlad / tmux.conf
Last active February 25, 2016 11:35
tmux config
set-option -g default-command "reattach-to-user-namespace -l zsh"
set -g default-terminal "screen-256color"
set -g history-limit 50000
# use VI
set-window-option -g mode-keys vi
# Decrease command delay to not interfere with vim
# don't wait for an escape sequence after hitting
# Esc. fixes insert mode exit lag in vim
set -sg escape-time 0
@suciuvlad
suciuvlad / gist:496497b3e28e77471b6d7871d722fb99
Last active May 30, 2016 12:00
mBit user profile intercom implementation
<script>
window.intercomSettings = {
app_id: "cgiwt8yt",
user_id: 1312182000, // integer
name: "Jane Doe", // Full name
nickname: 'Lil Jane',
email: "customer@example.com", // Email address
created_at: 1312182000 // Signup date as a Unix timestamp
};
</script>
@suciuvlad
suciuvlad / Enhance.js
Created July 2, 2016 16:20 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
@mixin padding($suffix: null) {
@if ($suffix != null) {
$suffix: \@#{$suffix};
}
@suciuvlad
suciuvlad / curried-add.js
Created October 13, 2016 15:20
Curried Add
function add(a,b,c){ return a+b+c; }
function curry(fn) {
return function curried() {
var args = [].slice.call(arguments);
return args.length >= fn.length ?
fn.apply(null, args) :
function () {
var rest = [].slice.call(arguments);
console.log(args);
@suciuvlad
suciuvlad / .htaccess
Last active July 8, 2017 07:46
wordpress + cloudfront + ssl + reverse proxy
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
import React, { Component } from 'react';
import { connect } from 'react-redux'
import { resetForm } from './actions';
const getDisplayName = WrappedComponent => {
return WrappedComponent.displayName || WrappedComponent.name;
}
const ReduxForm = (WrappedComponent, props) => {
const displayName = getDisplayName(WrappedComponent);
@suciuvlad
suciuvlad / fp.js
Created October 27, 2017 12:50
functional programming
const compose = (...fns) => x => fns.reduceRight((v, f) => f(v), x);
let curry = fn => { // (1)
let arity = fn.length; //(2) number of arguments fn expects
return (...args) => { // (3)
let firstArgs = args.length; // (4)
if (firstArgs >= arity) { //correct number of arguments
return fn(...args); // (5)
} else {
@suciuvlad
suciuvlad / intercom.js
Last active January 13, 2025 04:04
intercom
//Set your APP_ID
var APP_ID = "keznqdgj";
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;
s.src='https://widget.intercom.io/widget/' + APP_ID;
window.Intercom('boot', {
app_id: 'abc12345',
email: 'example@example.com',
user_id: 'abc123',