View styledExtended.tsx
This file contains 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
const Background = styled(LinearGradient).attrs(() => ({ | |
colors: ['#464769', '#1B1A1F'], | |
}))` | |
padding-top: 50px; | |
flex: 1; | |
` |
View view.controller.tsx
This file contains 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 { Context, dependency, Get, render, TokenRequired } from '@foal/core'; | |
import * as React from 'react'; | |
import * as ReactDOMServer from 'react-dom/server'; | |
import { User } from '../entities'; | |
import { TypeORMStore } from '@foal/typeorm'; | |
export class ViewController { | |
@dependency | |
store: TypeORMStore; |
View retry.js
This file contains 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
const retry = (fn, options = {}) => new Promise((resolve, reject) => { | |
const { retryInterval = 500, retries = 1 } = options; | |
fn() | |
.then(resolve) | |
.catch(err => ( | |
(retries === 0) | |
? reject(err) | |
: setTimeout( | |
() => retry(fn, { retryInterval, retries: retries - 1 }).then(resolve, reject), | |
retryInterval, |
View script.conf
This file contains 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
# save it on /etc/init | |
start on startup | |
task | |
exec /path/to/command |
View index.html
This file contains 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
<html> | |
<head> | |
<script> | |
function myFunc() { | |
var email = document.getElementById("email").value | |
var e = document.getElementById("select") | |
var selectedOption = e.options[e.selectedIndex].value | |
var checkBox = document.getElementById('defaultCheck1').checked | |
if (email == 'foo@bar' && checkBox && selectedOption == "audi") { |
View test2.js
This file contains 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
browser | |
.setValue('input[placeholder=E-mail]', email) | |
.setValue('input[placeholder=Password]', password) | |
.useXpath() | |
.click("//*[text()='Login']") | |
.pause(200) | |
.expect.element("//*[text()='John Doe']").to.be.present |
View test1.js
This file contains 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
browser | |
.setValue('.input-text', email) | |
.setValue('input.input-text[type=password]', password) | |
.click('.btn-success') | |
.pause(200) | |
.assert.urlEquals(url) | |
.end() |
View MockPromise.js
This file contains 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
class MockPromise { | |
then(fn) { | |
this.thenFn = fn | |
return this | |
} | |
catch(fn) { | |
this.catchFn = fn | |
return this | |
} |
View replace-mongo.js
This file contains 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 cursor = db.places.find(); | |
while (cursor.hasNext()) { | |
var x = cursor.next(); | |
x['source']['url'].replace('aaa', 'bbb'); // is this correct? | |
db.foo.update({_id : x._id}, x); | |
} |
View gist:4676702
This file contains 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 allJs = document.getElementsByTagName('script'), | |
lastJs = allJs[allJs.length-1], | |
logoJs = document.createElement('script'); | |
logoJs.src = 'http://qa2.obaoba.com.br/sites/obaoba.com.br/themes/obaoba2010/js/troca-logo.js'; | |
lastJs.parentNode.appendChild(logoJs); |
NewerOlder