Skip to content

Instantly share code, notes, and snippets.

View GreenGeorge's full-sized avatar
🏠
Working from home

George Ananda GreenGeorge

🏠
Working from home
View GitHub Profile
// ...
const raffleObject = {
product: product.handle,
variant: form.size,
timestamp,
identity_no: identityNo,
instagram_handle: instagramHandle,
phone,
};
CF.customer.set('raffle', [raffleObject]);
// ...
const raffleObject = {
product: product.handle,
variant: form.size,
timestamp,
identity_no: identityNo,
instagram_handle: instagramHandle,
phone,
};
CF.customer.set('raffle', [raffleObject]);
// ...
CF.customerReady(() => {
const customer = CF.customer.get('code');
const props = {customer: customer};
const container = document.getelementById('container');
const formElement = React.createElement(form, props)
ReactDOM.render(formElement, container);
});
@GreenGeorge
GreenGeorge / NetworkIdentifier.swift
Created March 29, 2019 06:50
Swift network identifier class
//
// NetworkIdentifier.swift
// networkIdentifier
//
// Created by George Ananda on 29/03/19.
// Copyright © 2019 George Ananda. All rights reserved.
//
import Foundation
import SystemConfiguration.CaptiveNetwork
@GreenGeorge
GreenGeorge / cloudSettings
Last active November 20, 2019 16:26
VIM Config gile
{"lastUpload":"2019-11-20T16:26:37.250Z","extensionVersion":"v3.4.3"}
@GreenGeorge
GreenGeorge / exists.js
Last active October 25, 2016 03:38
Helper function to determine if an element exists or not in the dom
const exists = element => {
return document.querySelector(element) != null ? true : false;
}
export default exists;
var debug = process.env.NODE_ENV !== 'production';
var webpack = require('webpack');
module.exports = {
context : __dirname + '/src',
devtool : debug ? "inline-sourcemap" : null,
entry : './js/client.js',
module : {
loaders: [
@GreenGeorge
GreenGeorge / package.json
Last active March 30, 2016 04:59
starter package.json for React projects
{
"name": "react-learn-redux",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"preinstall": "npm-check-updates -u",
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack-dev-server --content-base src --inline --hot"
},
@GreenGeorge
GreenGeorge / Gruntfile.js
Created August 4, 2013 04:24
Gruntfile configs i normally use for wordpress development. still lacks build tasks. Based heavily on Yeoman's grunt workflow
/* Grunt tasks for developing wordpress themes to suit George Ananda's workflow
Autoloads all grunt modules via matchdep
Configures Dev and Dist directory variables for use in tasks
Initializes Grunt :
Watch : Watch html, php, css, js, & img files - livereloads browser on change
Watch sass files - compiles into css with compass on change
Open : Opens dev url on browser
Compass : Compiles files on sass folder to css
*/
@GreenGeorge
GreenGeorge / detectOrientation.js
Created May 29, 2012 05:55
On load detects device orientation and adds the appropriate class to body. also listens for orientation changes and does the same thing. updates a notifier div and logs to console for dev purposes
$(function detectOrientation(){
var notifier = document.getElementById('notifier');
var body = $('body');
// set body class to portrait
function setPortrait() {
// notifier.innerHTML="now in portrait mode";
body.addClass('portrait').removeClass('landscape');
console.log( 'now in portrait mode' );