Skip to content

Instantly share code, notes, and snippets.

Jaime Molina jasmo2

Block or report user

Report or block jasmo2

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View flattenImplementation.js
function isFlattenable(value) {
return Array.isArray(value)
}
function flattenImplementation (array, depth = Infinity, isStrict, result = []) {
let index = -1
let length = array.length
while (++index < length) {
var value = array[index]
View netliformsintegration.ts
import React, { useState } from 'react'
import get from 'ts-get'
import { useTheme } from 'emotion-theming'
import styled from '~/theme/types'
import Navbar from '~/components/organisms/Header'
import Footer from '~/components/organisms/Footer'
interface BlogPageProps {
location: {
View advanceTransitionConfig.js
import { fromRight, fromBottom } from '../lib/transitions';
const screenVerification = ({ prevScene, nextScene }, prevScreen, nextScreen) => {
if (
prevScene &&
prevScene.route.routeName === prevScreen &&
nextScene.route.routeName === nextScreen
) {
return true;
}
View fromRightAdvanceFunction.js
/*
* At this point the method receive and object
* which has duration as well as percentageRange
* that will be in charge of pushing the outgoing
* screen
*/
export function fromRight({ duration = 300, percentageRange = 0 }) {
return {
transitionSpec: {
View fromRightSimpleFunction.js
export function fromRight(duration = 300) {
return {
transitionSpec: {
duration,
easing: Easing.out(Easing.poly(4)),
timing: Animated.timing,
useNativeDriver: true,
},
screenInterpolator: ({ layout, position, scene }) => {
const { index } = scene;
View basicAnimation.jsx
const initialValue = new Animated.Value(0)
Animated.timing(
// Animate value over time
initialValue, // The value to drive
{
toValue: 1, // Animate to final value of 1
},
).start(); // Start the animation
@jasmo2
jasmo2 / Dokku v0.5.6 Rails App.md
Created Apr 21, 2017 — forked from Epigene/Dokku v0.5.6 Rails App.md
Knowledge-Base for getting a Rails5 app with Cable running on dokku v0.5.6
View Dokku v0.5.6 Rails App.md

Dokku v0.5.6 Rails workflow

Straight to Maintenance

0. Set up Droplet

Initialize the droplet with dokku app pre-setup
@jasmo2
jasmo2 / phoenix_to_umbrella
Created Sep 6, 2016 — forked from emilsoman/phoenix_to_umbrella
How to move an existing phoenix app under an umbrella app
View phoenix_to_umbrella
How to convert existing phoenix app to an umbrella app.
https://elixir-lang.slack.com/archives/phoenix/p1472921051000134
chrismccord [10:14 PM]
@alanpeabody yes, it's straightforward
[10:14]
1) mix new my_umbrella --umbrella
@jasmo2
jasmo2 / sort.rb
Created Jul 5, 2016 — forked from aspyct/sort.rb
Sample implementation of quicksort, mergesort and binary search in ruby
View sort.rb
# Sample implementation of quicksort and mergesort in ruby
# Both algorithm sort in O(n * lg(n)) time
# Quicksort works inplace, where mergesort works in a new array
def quicksort(array, from=0, to=nil)
if to == nil
# Sort the whole array, by default
to = array.count - 1
end
You can’t perform that action at this time.