Skip to content

Instantly share code, notes, and snippets.

env:
matrix:
- GOPATH=$TRAVIS_BUILD_DIR/gosrc
global:
- secure: XXXXXX
- secure: XXXXXX
install:
- mkdir -p "$TRAVIS_BUILD_DIR/gosrc"
- mkdir -p "$TRAVIS_BUILD_DIR/static"
- curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bash
@sheki
sheki / config.json
Created December 24, 2014 02:27
example parse config
{
"applications": {
"_default": {
"link": "sheki"
},
"sheki": {
"applicationId": "{{.AppID}}",
"masterKey": "{{.MasterKey}}"
}
},
-
+ -- cloud
+ -- config # contains your keys
+ -- public # contains the static files
package main
import (
"os"
"text/template"
)
const parseConfig = `
{
"applications": {
#!/bin/bash -e
$GOPATH/bin/hugo --theme=purehugo # generate hugo site.
PARSE_CONFIG_DIR="parse_app/config"
mkdir -p "$PARSE_CONFIG_DIR" # git does not allow empty dirs to be checked in.
cp -rf public parse_app/public # copy generated website to parse_app location
go run scripts/gen_travis_parse_keys.go > "$PARSE_CONFIG_DIR/global.json" #gen keys.
cd parse_app
parse deploy #deploy to parse
var cacheKey string
if session.IndexCaching {
cacheKey = c.FullName + "\x00" + keyInfo.name
if session.cluster().HasCachedIndex(cacheKey) {
return nil
}
}
#suggested
if !session.disableCaching {
int mode(int[] array) int {
int mode = -1;
int maxCount = 0;
for (int i =0 ; i < array.length; i++) {
int count = 0;
for (int j=i; j < array.length; j++) {
if array[i] == array[j] {
count++
}
}
@sheki
sheki / ScrollView.js
Created July 20, 2015 03:51
index.ios.js
'use strict';
var React = require('react-native');
var ParseReact = require('parse-react');
Parse.initialize('O23lje4UAXbWj91T1y3qAMLAMIHx29rDkU2aB9z6', 'cFeJ1DQbXaSbtov0Fwc4TbTlJnfQiikfGwE19S0e');
var {
Image,
ListView,
StyleSheet,
@sheki
sheki / FrontView.js
Last active August 29, 2015 14:27
react_help.jsx
'use strict';
var React = require('react-native');
var ProfileView = require('./ProfileView');
var {
StyleSheet,
View,
} = React;