This file contains hidden or 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
Thu Jul 16 05:52:50 UTC 2020 |
This file contains hidden or 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
const functions = require('firebase-functions'); | |
// // Create and Deploy Your First Cloud Functions | |
// // https://firebase.google.com/docs/functions/write-firebase-functions | |
// | |
// exports.helloWorld = functions.https.onRequest((request, response) => { | |
// response.send("Hello from Firebase!"); | |
// }); | |
// Import the Firebase SDK for Google Cloud Functions. |
This file contains hidden or 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
# Created by newuser for 5.2 | |
export ZPLUG_HOME=/usr/local/opt/zplug | |
source $ZPLUG_HOME/init.zsh | |
# Alias | |
alias emacs='emacs -nw' | |
alias ls='ls -G -F' | |
## Android studio | |
export ANDROID_HOME=$HOME/Development/adt-bundle-mac/sdk |
This file contains hidden or 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 org.junit.runner.JUnitCore; | |
import org.junit.runner.Result; | |
import org.junit.runner.notification.Failure; | |
public class TestRunner { | |
public static void main(String[] args) { | |
Result result = JUnitCore.runClasses(PermTest.class); | |
for (Failure failure : result.getFailures()) { | |
System.out.println(failure.toString()); |
This file contains hidden or 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 java.util.*; | |
import org.junit.*; | |
import static org.junit.Assert.*; | |
public class PermTest { | |
@Test | |
public void testCountPermutation(){ | |
Perm p = new Perm(1); | |
assertEquals(1, p.countPermutation()); | |
} |
This file contains hidden or 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 SharedViewModel extends ViewModel {} | |
public class MasterFragment extends Fragment { | |
private SharedViewModel model; | |
public void onCreate(Bundle savedInstanceState) { | |
model = ViewModelProviders.of(getActivity()) | |
.get(SharedViewModel.class); //<- 共通のviewmodel | |
} | |
} |
This file contains hidden or 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 MainActivity extends AppCompatActivity { | |
public Realm mRealm; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
mRealm = Realm.getDefaultInstance(); | |
mRealm.beginTransaction(); |
This file contains hidden or 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 Bread extends RealmObject { | |
public String name; | |
public boolean isEdible; | |
@Ignore | |
public int price; | |
public String getName() { | |
return name; | |
} |
This file contains hidden or 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 User extends RealmObject { | |
@PrimaryKey | |
public long id; | |
public String name; | |
public RealmList<Bread> breads; | |
public long getId() { | |
return id; | |
} |
This file contains hidden or 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 MyApplication extends Application { | |
@Override | |
public void onCreate(){ | |
super.onCreate(); | |
Realm.init(getApplicationContext()); | |
RealmConfiguration c = new RealmConfiguration.Builder().build(); | |
// Use below if you are in the middle of development and changing your schema. | |
// RealmConfiguration config = new RealmConfiguration.Builder().deleteRealmIfMigrationNeeded().build(); |
NewerOlder