Skip to content

Instantly share code, notes, and snippets.

@beall49
beall49 / arraySort.js
Last active August 29, 2015 14:27
take a comma seperated string and sort it in javascript
$('#btnSubmit').on('click',
function(){
var words = $("#txtInput").val().replace(/ /g,'').split(",");
$("#txtInput").val(words.sort());
}
);
$('#btnSubmit').on('click',
function(){
var finalWords = [];
var txt = $("#txtInput").val().replace(/ /g,'');
var words = txt.split(",");
var newWords = words.sort();
for(x in newWords){
var str = newWords[x];
if (x>0){
str = " " + str
package rbeall.cfexcel.utils;
import com.google.gson.annotations.SerializedName;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import java.text.SimpleDateFormat;
import java.util.Calendar;
package rbeall.cfexcel;
import android.app.Activity;
import android.graphics.PorterDuff;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
tools:context="rbeall.cfexcel.Web">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
@beall49
beall49 / Enums.java
Created January 7, 2016 15:29
Just a good example of enum in android
/*
*/
public enum div {
DIVINNER("div#wodinnerind"), DIVRIGHT("div#wodright");
private final String text;
div(final String text) {
this.text = text;
}
package rbeall.cfexcel.db;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
public class ArticleDB {
//db context stuff
private ArticleDBHelper helper;
private final Context context;
private SQLiteDatabase db;
package rbeall.cfexcel.db;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import rbeall.cfexcel.MainActivity;
public class ArticleDBHelper extends SQLiteOpenHelper {
private static ArticleDBHelper sInstance;
package rbeall.cfexcel.db;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteStatement;
import java.util.ArrayList;
import rbeall.cfexcel.utils.Articles;
import rbeall.cfexcel.utils.GsonArticle;
import rbeall.cfexcel.utils.Utilities;
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="300dp"
app:cardUseCompatPadding="true"
app:cardElevation="@dimen/elevation">
<RelativeLayout
android:layout_width="match_parent"