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 | |
function setjdk() { | |
if [ $# -ne 0 ]; then | |
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin' | |
if [ -n "${JAVA_HOME+x}" ]; then | |
removeFromPath $JAVA_HOME | |
fi | |
export JAVA_HOME=`/usr/libexec/java_home -v $@` | |
export PATH=$JAVA_HOME/bin:$PATH |
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 YourCustomAdapter extends ArrayAdapter<Integer> { | |
private static final int LAYOUT_ID = R.layout.adapter_custom_list_item; | |
public YourCustomAdapter(Context context, List<Integer> imageIds) { | |
super(context, LAYOUT_ID, imageIds); | |
} | |
@Override | |
public View getView(int position, View convertView, ViewGroup parent) { |
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
> db.spike.insert({sensorName:"name",sensorData:[{prop:"foo"},{prop:"foo1"}]}) | |
WriteResult({ "nInserted" : 1 }) | |
> db.spike.find() | |
{ "_id" : ObjectId("5515b49ee2666b1d26be97ce"), "sensorName" : "name", "sensorData" : [ { "prop" : "foo" }, { "prop" : "foo1" } ] } | |
> db.spike.update({sensorName:{$eq:"name"}},{$set:{"sensorData.0":{"prop":"works"}}}) | |
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) | |
> db.spike.find() | |
{ "_id" : ObjectId("5515b49ee2666b1d26be97ce"), "sensorName" : "name", "sensorData" : [ { "prop" : "works" }, { "prop" : "foo1" } ] } |
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
echo '{"foo": "lorem", "bar": "ipsum"}' | python -m json.tool |
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
/** | |
* A collection of authentication and account connection utilities. With strong inspiration from the Google IO session | |
* app. | |
* @author Dandré Allison | |
*/ | |
public class AccountUtils { | |
/** | |
* Interface for interacting with the result of {@link AccountUtils#getUserProfile}. | |
*/ |
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.burningriverbitworks.myapplicatiozen; | |
import android.accounts.Account; | |
import android.accounts.AccountManager; | |
import android.app.Application; | |
import android.content.Context; | |
import android.database.Cursor; | |
import android.provider.ContactsContract; | |
import android.telephony.TelephonyManager; | |
import android.test.ApplicationTestCase; |
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
with numbers (number) as ( | |
select number = 1 | |
union all | |
select number = number + 1 | |
from numbers | |
where number < 102 | |
) select | |
number, | |
case |
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
def all_css_files_in(files_file) | |
css_files = [] | |
File.readlines(files_file).each { |line| | |
unless line.start_with?("/Style%20Library","styles","http","/_control") | |
css_files << line.gsub("/_layouts/ui/css/","").gsub("?ver=20131220130545","").gsub("?ver=20131220130545","").gsub("?ver=20131220130545","") | |
end | |
} | |
css_files | |
end |
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
require 'anemone' | |
require 'nokogiri' | |
require 'set' | |
@url = "http://my.clevelandclinic.org/default.aspx" | |
@moss_garbage = "layouts/1033/styles" | |
@css_link_set = Set.new | |
@flash_link_set = Set.new |
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
*.csproj -text merge=union | |
*.sln -text merge=union |