System directories
| Method | Result |
|---|---|
| Environment.getDataDirectory() | /data |
| Environment.getDownloadCacheDirectory() | /cache |
| Environment.getRootDirectory() | /system |
External storage directories
| $.xhrPool = []; | |
| $.xhrPool.abortAll = function() { | |
| /* Original example used _underscore api | |
| _.each(this, function(jqXHR) { | |
| jqXHR.abort(); | |
| }); | |
| */ | |
| $.each(this, function(jqXHR) { | |
| jqXHR.abort(); |
| <ul id="members" data-role="listview" data-filter="true"> | |
| <!-- ... more list items ... --> | |
| <li> | |
| <a href="detail.html?id=10"> | |
| <h3>John Resig</h3> | |
| <p><strong>jQuery Core Lead</strong></p> | |
| <p>Boston, United States</p> | |
| </a> | |
| </li> | |
| <!-- ... more list items ... --> |
| function countCSSRules() { | |
| var results = '', | |
| log = ''; | |
| if (!document.styleSheets) { | |
| return; | |
| } | |
| for (var i = 0; i < document.styleSheets.length; i++) { | |
| countSheet(document.styleSheets[i]); | |
| } | |
| function countSheet(sheet) { |
| #!/usr/bin/env python | |
| """ | |
| Very simple HTTP server in python (Updated for Python 3.7) | |
| Usage: | |
| ./dummy-web-server.py -h | |
| ./dummy-web-server.py -l localhost -p 8000 | |
| Send a GET request: |
| # Makefile for a go project | |
| # | |
| # Author: Jon Eisen | |
| # site: joneisen.me | |
| # | |
| # Targets: | |
| # all: Builds the code | |
| # build: Builds the code | |
| # fmt: Formats the source files | |
| # clean: cleans the code |
| package main | |
| import ( | |
| "fmt" | |
| "labix.org/v2/mgo" | |
| "labix.org/v2/mgo/bson" | |
| "time" | |
| ) | |
| type Person struct { |
| package main | |
| import ( | |
| "fmt" | |
| "reflect" | |
| ) | |
| type Foo struct { | |
| FirstName string `tag_name:"tag 1"` | |
| LastName string `tag_name:"tag 2"` |
System directories
| Method | Result |
|---|---|
| Environment.getDataDirectory() | /data |
| Environment.getDownloadCacheDirectory() | /cache |
| Environment.getRootDirectory() | /system |
External storage directories
| // program | |
| package main | |
| import "os/signal" | |
| import "os" | |
| import "fmt" | |
| import "syscall" | |
| import "time" |
| <?xml version="1.0" encoding="utf-8"?> | |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| package="com.example" | |
| android:versionCode="1" | |
| android:versionName="1.0"> | |
| <uses-sdk android:minSdkVersion="8"/> | |
| <uses-permission android:name="android.permission.READ_CONTACTS" /> | |
| <application android:label="@string/app_name"> |