This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div><img src="https://llamaly-assets.s3.us-east-2.amazonaws.com/images/logo-large.jpg" /></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$user = User::whereToken($token)->first(); | |
if (!$user) { | |
return ['message' => 'Sorry, no user found with that token.']; | |
} | |
return $user; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onMoveShouldSetPanResponder: (e, g) => { | |
if (g.dx === 0 || g.dy === 0) return false; | |
return true; | |
}, | |
// Or if you like 1 liners: | |
onMoveShouldSetPanResponder: (e, g) => !(g.dx === 0 || g.dy === 0), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static boot | |
static bootTraits | |
static clearBootedModels | |
static addGlobalScope | |
static hasGlobalScope | |
static getGlobalScope | |
static observe | |
static hydrate | |
static hydrateRaw | |
static create |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bind in constructor | |
class BindInConstructor { | |
constructor() { | |
this.foo = this.foo.bind(this); | |
this.bar = this.bar.bind(this); | |
} | |
foo() { | |
this.bar(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
hosts=( | |
# list the hosts to grab the logs from | |
host1.foo.com | |
host2.foo.com | |
) | |
remote_files=( | |
# list the log files to grab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function __call($method, $args) { | |
if (! $this->isConnected() || ! method_exists($this->pdo, $method)) { | |
throw new \BadMethodCallException("Method '$method' not found on ExtendedPdo"); | |
} | |
return call_user_func_array([$this->pdo, $method], $args); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var imageUrls = [/* image urls here */]; | |
// The basic prefetch and forget. | |
imageUrls.map((url) => Image.prefetch(url)); | |
// ------------- OR ------------- | |
// Prefetch and replace image urls that fail to load with a default image URL | |
// Note: You could/should bundle the default image with the app so it doesn't | |
// need prefetched, and would load instantly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { combineReducers } from 'redux'; | |
/** | |
* Combine a set of ReduxModel reducers. | |
* | |
* @param array {models} An array of ReduxModel objects. | |
* @return function A combined redux reducer | |
*/ | |
export function combineModelReducers(models) { | |
let reducers = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { | |
Component, | |
PropTypes, | |
} from 'react'; | |
import { | |
ScrollView as RNScrollView, | |
View, | |
} from 'react-native'; |
NewerOlder