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
/* Requirements | |
+ -- | |
+ require.js | |
+ // load require.js like so | |
+ <script data-main="scripts/main" src="scripts/require.js"></script> | |
+ -- | |
+ | |
require(["helper/e6.js"], function(e6){ | |
e6.init(); |
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
// | |
// This file is part of Smoothie. | |
// | |
// Copyright (C) 2013,14 Torben Haase, Flowy Apps ([email protected]) | |
// | |
// Smoothie is free software: you can redistribute it and/or modify it under the | |
// terms of the GNU Lesser General Public License as published by the Free | |
// Software Foundation, either version 3 of the License, or (at your option) any | |
// later version. | |
// |
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
//This is our base class | |
class BaseStateManager { | |
constructor() { | |
/* | |
store shape : | |
name : | |
state : -1, 0, 1 // this could change : -1 = not changed : 0 = changed but needs more work : 1 = finsihed | |
*/ | |
this.stores = []; |
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
//Java | |
webview.getSettings().setJavaScriptEnabled(true); | |
webview.loadUrl("<your html file>"); //not in scope of this gist | |
webview.setWebViewClient(new WebViewClient(){ | |
public void onPageFinished(WebView view, String url){ | |
//Here you want to use .loadUrl again | |
//on the webview object and pass in | |
//"javascript:<your javaScript function" | |
webview.loadUrl("javascript:myJavaScriptFunc('" + argumentPassingIn + "')"); //if passing in an object. Mapping may need to take place | |
} |
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
using System; | |
namespace Factory | |
{ | |
// Location class | |
public class Location | |
{ | |
public double Latitude {get; set;} | |
public double Longitude {get; set;} | |
} |
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
using System; | |
namespace Test { | |
//Interfaces : contracts for classes to be used for compoisiton | |
public interface IEat<T>{ | |
//set the food level | |
int Consume(T Item); | |
} | |
public interface ISpecies{ |
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
using System; | |
namespace PalindromeTest { | |
/* ------- | |
* Table - store palindromes : Multi Dimensional Array | |
* ========= | |
* Checks for palindrom | |
* - Each letter will be a palindrom | |
* - - Set this as "True" in our Table AND set the new longest palindrome |
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 nock from 'nock'; | |
import request from 'superagent'; | |
describe('Calling AWS SDK to sign up a user', () => { | |
let postData = {username: '[email protected]', password: '@Password1'}; | |
let _request = null; | |
beforeEach(() => { | |
nock('http://aws-sdk.aws.com/', { |
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
using System; | |
public class Program | |
{ | |
public static int GetMissingNumberFromArray(int[] arr) | |
{ | |
Console.WriteLine("======================="); | |
int totalXor = 0; | |
int totalArrXor = 0; |
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
/* =============== CONSTANTS ============================ */ | |
export const AWS_SIGN_UP_SAVING = 'AWS_SIGNUP_SAVE'; | |
export const AWS_SIGN_UP_FAIL = 'AWS_SIGN_UP_FAIL'; | |
export const AWS_SIGN_UP_SUCCESS = 'AWS_SIGN_UP_SUCCESS'; | |
export const THROW_ERROR = 'THROW_ERROR'; | |
export const CLEAR_ERROR = 'CLEAR_ERROR'; | |
OlderNewer