Skip to content

Instantly share code, notes, and snippets.

🤙
Forever coding

Mitch Tabian mitchtabian

🤙
Forever coding
Block or report user

Report or block mitchtabian

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View settings.ini
[settings]
DEBUG=True
SECRET_KEY=y#bz$z0prv)@bie(@3wa@=--ana7%%k!hvo)b-3d4#0mnhh0pi6
AWS_ACCESS_KEY_ID=M5YCPZP3QT36OWMMZS23
AWS_SECRET_ACCESS_KEY=5Npq/S/7tX2IqBl51p3QEAMJuuGvHuFH4680Cl59M3s
AWS_STORAGE_BUCKET_NAME=open-api-space
AWS_S3_ENDPOINT_URL=https://nyc3.digitaloceanspaces.com
AWS_LOCATION=open-api-static
View settings.py
INSTALLED_APPS = [
# My apps
'personal',
'account',
'blog',
# django apps
'django.contrib.admin',
View djangoproject
server {
listen 80;
server_name <ip>;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/mitch/djangoprojectdir;
}
location / {
View gunicorn.service
[Unit]
Description=gunicorn daemon for django project
Requires=gunicorn.socket
After=network.target
[Service]
User=mitch
Group=www-data
WorkingDirectory=/home/mitch/djangoprojectdir
ExecStart=/home/mitch/djangoprojectdir/djangoprojectenv/bin/gunicorn \
View settings.py
INSTALLED_APPS = [
# My apps
'personal',
'account',
'blog',
# django apps
'django.contrib.admin',
View SessionManager.java
public void authenticateWithId(final LiveData<AuthResource<User>> source) {
if(cachedUser != null){
cachedUser.setValue(AuthResource.loading((User)null));
cachedUser.addSource(source, new Observer<AuthResource<User>>() {
@Override
public void onChanged(AuthResource<User> userAuthResource) {
cachedUser.setValue(userAuthResource);
cachedUser.removeSource(source);
if(userAuthResource.status.equals(AuthResource.AuthStatus.ERROR)){
View NoteActivity.java
private GestureDetector mGestureDetector;
private void setListeners(){
mGestureDetector = new GestureDetector(this, this);
linedEditText.setOnTouchListener(this);
check.setOnClickListener(this);
viewTitle.setOnClickListener(this);
View home.html
<p><strong>Table of Contents:</strong></p>
<ul>
<li><a href='#1'>Introduction</a></li>
<li><a href='#2'>Methods for onPressed</a></li>
<li><a href='#3'>FlatButton</a></li>
<li><a href='#4'>RaisedButton</a></li>
<li><a href='#5'>IconButton</a></li>
<li><a href='#6'>OutlineButton</a></li>
<li><a href='#7'>Final Thoughts</a></li>
View Thing.kt
public LiveData<Resource<PlaylistContents>> observePlaylistData(String id) {
if (playlistContentsLiveData == null) {
playlistContentsLiveData = new MutableLiveData<>();
playlistContentsLiveData.postValue(Resource.loading((PlaylistContents) null));
apiService.getPlaylistContents(CharParser.removeEmptySpaces(id))
.subscribeOn(Schedulers.io())
.subscribe(data -> playlistContentsLiveData.postValue(Resource.success(data)),
e -> playlistContentsLiveData.postValue(Resource.error(e.getMessage(), (PlaylistContents) null)));
View Thing.kt
class MovieRepository @Inject
constructor(var apiService: ApiService) {
fun fetchDiscoverMovies(page: Int): LiveData<Resource<DiscoverMovieResponse>> {
return LiveDataReactiveStreams.fromPublisher(
apiService.fetchDiscoverMovie(page) // returns Flowable<DiscoverMovieResponse>
.subscribeOn(Schedulers.io())
.map { d: DiscoverMovieResponse -> Resource.success(d) }
.onErrorReturn { e -> Resource.error(e.message, null) }
)
You can’t perform that action at this time.