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
#!/bin/bash | |
validator() { | |
printf "* %-48s" "$1" | |
echo "$1" | egrep --quiet "^([A-Za-z]+[A-Za-z0-9]*((\.|\-|\_)?[A-Za-z]+[A-Za-z0-9]*){1,})@(([A-Za-z]+[A-Za-z0-9]*)+((\.|\-|\_)?([A-Za-z]+[A-Za-z0-9]*)+){1,})+\.([A-Za-z]{2,})+" | |
[ $? -eq 0 ] && printf "\e[1;32m[pass]\e[m" || printf "\e[1;31m[fail]\e[m" | |
echo | |
} | |
echo |
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
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
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
<!DOCTYPE html | |
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | |
<head> | |
<title>JSend</title><link rel="start" href="/labs/jsend/wiki" /><link rel="search" href="/labs/jsend/search" /><link rel="help" href="/labs/jsend/wiki/TracGuide" /><link rel="stylesheet" href="/labs/css/trac.css" type="text/css" /><link rel="stylesheet" href="/labs/css/wiki.css" type="text/css" /><link rel="icon" href="/favicon.ico" type="image/x-icon" /><link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /><link rel="alternate" href="/labs/jsend/wiki/WikiStart?format=txt" title="Plain Text" type="text/x-trac-wiki" /><style type="text/css"> | |
</style> | |
<script type="text/javascript" src="/labs/js/trac.js"></script> | |
</head> |
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
= JSend = | |
* '''What?''' - Put simply, JSend is a specification that lays down some rules for how [http://json.org JSON] responses from web servers should be formatted. JSend focuses on application-level (as opposed to protocol- or transport-level) messaging which makes it ideal for use in [http://en.wikipedia.org/wiki/Representational_State_Transfer REST]-style applications and APIs. | |
* '''Why?''' - There are lots of web services out there providing JSON data, and each has its own way of formatting responses. Also, developers writing for JavaScript front-ends continually re-invent the wheel on communicating data from their servers. While there are many common patterns for structuring this data, there is no consistency in things like naming or types of responses. Also, this helps promote happiness and unity between backend developers and frontend designers, as everyone can come to expect a common approach to interacting with one another. | |
* '''Hold on now, aren't there already specs for this kind of thi |
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
// Handle sending offenders off to the box where they will feel shame. | |
// Modified now support #hashtag, @username and keywords | |
// Original file at https://github.com/jeffreyiacono/penalty-blox/blob/master/js/referee.js | |
function Referee() { | |
return this; | |
} | |
/** | |
* use background / extension messaging to bridge popup with localStore | |
* get all penalty boxed entries and remove them along with settings |
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
public class FullScreen extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
requestWindowFeature(Window.FEATURE_NO_TITLE); | |
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
WindowManager.LayoutParams.FLAG_FULLSCREEN); | |
setContentView(R.layout.main); |
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
<EditText | |
android:id="@+id/EditText02" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:lines="5" | |
android:gravity="top|left" | |
android:inputType="textMultiLine" | |
android:scrollHorizontally="false" | |
/> |
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
android:isIndicator="true" |
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
package com.tediscript.android; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
public class Settings { | |
public static String PREFS_NAME = "com.tediscript.android.settings"; | |
public static void putString(Context ctx, String key, String value) { |
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
android.os.Process.killProcess(android.os.Process.myPid()); |
NewerOlder