Skip to content

Instantly share code, notes, and snippets.

View EQuimper's full-sized avatar
🏠
Working from home

Emanuel Quimper EQuimper

🏠
Working from home
View GitHub Profile
@terrysahaidak
terrysahaidak / createPersist.js
Created September 24, 2018 21:32
Mobx-state-tree persist
import { applySnapshot, onSnapshot } from 'mobx-state-tree';
import { transaction } from 'mobx';
import { AsyncStorage } from 'react-native';
const getSnapshots = (storesList, storage) => {
const promises = storesList.map(storeName =>
storage.getItem(storeName),
);
return Promise.all(promises).then(snapshots =>
@wcandillon
wcandillon / wallet-animation.js
Created September 3, 2018 09:28
React Native Apple Wallet Animation
import React from "react";
import {
StyleSheet,
Text,
View,
ScrollView,
Animated,
SafeAreaView,
Dimensions
} from "react-native";
@jswny
jswny / Flexible Dockerized Phoenix Deployments.md
Last active July 3, 2023 05:25
A guide to building and running zero-dependency Phoenix (Elixir) deployments with Docker. Works with Phoenix 1.2 and 1.3.

Prelude

I. Preface and Motivation

This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.

For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai

@lededje
lededje / testSetup.js
Created January 8, 2018 01:41
This is a gist that patches react-native's components and apis with jest to allow you to use Enzyme's react 16 adapter
import React from 'react';
jest.mock('react-native', () => {
const createMockComponent = (name) => {
const mockedComponent = ({ children }) => (
<div>{children}</div>
);
mockedComponent.displayName = name;
return mockedComponent;
}
@dopey
dopey / main.go
Last active April 30, 2024 15:59 — forked from denisbrodbeck/main.go
How to generate secure random strings in golang with crypto/rand.
package main
import (
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"math/big"
)
@giladno
giladno / .vimrc
Last active December 16, 2018 09:28
My .vimrc file
set autoindent
set autoread " Make Vim automatically open changed files
set background=dark
" set cinoptions=:0,(s,u0,U1
set clipboard=unnamed
set colorcolumn=120
set columns=130
set copyindent
set cursorline
set directory^=$HOME/.vim/swp//
@benjick
benjick / persist.js
Created June 15, 2017 11:09
mobx-state-tree persist PoC
/* globals localStorage */
import { onSnapshot, applySnapshot } from 'mobx-state-tree';
import Storage from './storage';
export const persist = (name, store, options, schema = {}) => {
let hydrated = false;
let storage = options.storage;
if (typeof localStorage !== 'undefined' && localStorage === storage) {
// @flow
import React, { Component } from 'react';
import {
VirtualizedList,
View,
ScrollView,
StyleSheet,
// $FlowFixMe
findNodeHandle,
@rockchalkwushock
rockchalkwushock / insurance.md
Last active August 21, 2017 12:47
Insurance for when your system crashes & so do your backups...

Insurance... in case shit happens!

This is what you should follow should your system crash & your external hard drive with your backups on it fail at the same time!

First scream FML!

Now proceed...

1. Apple

@eproxus
eproxus / README.md
Last active May 30, 2023 08:19 — forked from raysegantii/README.md
Use Bootstrap 4 SASS with Phoenix

Versions

  • Bootstrap 4 Alpha 6
  • Phoenix 1.2.1

Instructions

  1. Install npm packages

npm install --save-dev sass-brunch