Skip to content

Instantly share code, notes, and snippets.

View ardok's full-sized avatar
💭
derp town~

Ardo ardok

💭
derp town~
View GitHub Profile
@ardok
ardok / jest-config.browser.js
Created March 15, 2018 23:46
Running jest in node and browser env, then combine the coverage with istanbul
/* eslint-disable */
const common = require('../jest-config.common');
module.exports = Object.assign({}, common, {
"coverageDirectory": "<rootDir>/coverage/browser",
"testMatch": [
"**/test/browser/**/*.test.js"
],
"setupFiles": [
"<rootDir>/src/test/browser/setup.js"
]
@ardok
ardok / fixed-data-table-2-wrapper.js
Last active August 16, 2017 21:44
Fixed Data Table 2 Wrapper to have fixed right columns!
/* eslint-disable no-return-assign */
import React, {Component} from 'react';
import debounce from 'debounce';
import {Table, Column} from 'fixed-data-table-2';
function setHeadersFixed(containerEl) {
const els = containerEl.getElementsByClassName('fixedDataTableLayout_header');
[].forEach.call(els, (el) => {
const parentNode = el.parentNode;
@ardok
ardok / Test
Last active August 29, 2015 14:10
Adapter Sample
// this is adapter
public class UsersAdapter extends ArrayAdapter<RowItem> {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// use pattern holder, just Google it and you'll see
if (convertView == null) {
// ...
convertView.setTag(...);
} else {
// ...
@ardok
ardok / SassMeister-input.scss
Created March 13, 2014 21:30
Generated by SassMeister.com.
// ----
// Sass (v3.3.2)
// Compass (v1.0.0.alpha.18)
// ----
@mixin widthFull() {
width: 100%;
max-width: none;
}
@mixin heightFull() {
@ardok
ardok / BoxHelper.scala
Last active December 28, 2015 04:09
Box helper for Lift
import scalaz._
import Scalaz._
import xml.{Elem, NodeSeq}
import net.liftweb.util.CssSel
import net.liftweb.util.Helpers._
import net.liftweb.http.js.JsCmds.Noop
import net.liftweb.http.js.JsCmd
import net.liftweb.common.{Failure, Full, Box, Empty}
/**
@ardok
ardok / android_studio_sm_android
Last active December 17, 2015 13:19
Tutorial to setup StackMobAndroid SDK in Android Studio
Mac OS instruction:
* Download and install <a href="http://developer.android.com/sdk/installing/studio.html" target="_blank">Android Studio</a>
* Open Android Studio and select one of the options shown (for simplicity, this instruction selects New Project -> Blank Activity)
* Setup the name of your project, launcher icon, and other stuff that it asks you to
* In this instruction, the name of the app is `StackMobAndroidSDKTest`
* After the project window is open, add StackMob Android SDK into the `libs` directory <img src="https://s3.amazonaws.com/static.stackmob.com/images/android/as_sm_android_libs.png" style="margin: 20px 0 20px 0;" />
* Right click on the StackMob Android JAR file and select `Add as Library...` -> `OK` <img src="https://s3.amazonaws.com/static.stackmob.com/images/android/as_sm_android_add_as_library.png" style="margin: 20px 0 20px 0;" />
* Open `build.gradle` under `src` directory and add `compile files('<path_to_stackmob_android_sdk>')` <img src="https://s3.amazonaws.com/static.stackmob.
@ardok
ardok / name_me.md
Created October 3, 2012 00:23
Custom Code Param Parsing Tutorial

Objective

Parse parameters in custom code

Experience Level

Advanced

Estimated Time to Complete

~15 minutes

Prerequisites

@ardok
ardok / user_authentication.md
Created September 13, 2012 00:24
Second part for JS Tutorial

Objective

Login and Logout User

Experience Level

Beginner

Estimated Time to Complete

~5 minutes

Prerequisites

@ardok
ardok / create_a_user_object.md
Created September 11, 2012 23:17
These are docs for JS Tutorial

Objective

Create and save a new User object.

Experience Level

Beginner

Estimated Time to Complete

~5 minutes

Prerequisites

@ardok
ardok / start-js-sdk
Created August 28, 2012 22:30
This a doc for StackMob's JS SDK custom code (docs getting-started-cc-sdk)
**JS SDK**
```javascript
<script type="text/javascript">
StackMob.customcode('hello_world', {}, 'GET' //skip third param for default 'GET'. This can also be either 'POST', 'PUT', or 'DELETE'
{
success: function(jsonResult) {
//jsonResult is the JSON object: { "msg": "Hello, world!" }
},