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
<?php | |
function do_auth() { | |
// prompt for password | |
header('WWW-Authenticate: Basic realm="pbrisbin dot com"'); | |
header('HTTP/1.0 401 Unauthorized'); | |
// if user cancels | |
header('Content-type: text/plain'); | |
echo 'Not authorized.'; |
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
<?php require_once('path/to/authentication.php'); | |
$valid_users = array( 'user1' => 'password1' | |
, 'user2' => 'password2' | |
); | |
authenticate($valid_users); | |
// rest of page logic... |
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 Dzen | |
import RssReader | |
-- | |
-- this is it, the whole application in one line! | |
-- | |
main :: IO () | |
main = spawnDzen dzenConf >>= spawnReader readerConf |
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
myScratchPads = [ NS "mixer" spawnMixer findMixer manageMixer -- one scratchpad | |
, NS "terminal" spawnTerm findTerm manageTerm -- and a second | |
] | |
where | |
spawnMixer = "ossxmix" -- launch my mixer | |
findMixer = className =? "Ossxmix" -- its window has a ClassName of "Ossxmix" | |
manageMixer = customFloating $ W.RationalRect l t w h -- and I'd like it fixed using the geometry below: |
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
myKeys = [ ... | |
, ... | |
, ("M4-t" , scratchTerm ) | |
, ("M4-S-m" , scratchMixer) | |
, ... | |
] | |
where |
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
myManageHook = ([ -- whatever it might be... | |
, ... | |
, ... | |
]) <+> namedScratchpadManageHook myScratchPads -- this manages the entire list of scratchpads | |
-- based on the query and hook listed for each |
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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:padding="15dip" > | |
<TextView android:id="@+id/label" | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:text="@string/label" /> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<string name="app_name">Raw Audio</string> | |
<string name="my_server">http://pbrisbin.com:8000/mpd.mp3</string> | |
<string name="label">Enter stream url:</string> | |
<string name="play_pause">Play/Pause</string> | |
</resources> |
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 rawAudio.apk; | |
import android.app.Activity; | |
import android.content.ComponentName; | |
import android.content.Intent; | |
import android.content.ServiceConnection; | |
import android.os.Bundle; | |
import android.os.IBinder; |
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
@Override public void onDestroy() { | |
// disconnect from our service | |
unbindService(onService); | |
super.onDestroy(); | |
} |
OlderNewer