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
from django.contrib import admin | |
from django.contrib.auth.admin import UserAdmin | |
from .models import Account | |
from django.utils.translation import ngettext | |
from django.contrib import messages | |
class UserAdmin(admin.ModelAdmin): | |
actions = ('mark_as_active', 'mark_as_inactive') # Add your actions here | |
list_display = ( |
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
sealed class LoginState {} | |
class LoginLoadingState extends LoginState{} | |
class LoginSuccessState extends LoginState{} | |
class LoginFailureState extends LoginState{} | |
class LoginRedirectState extends LoginState{} | |
void handleLoginState(LoginState state) { | |
switch(state) { | |
case LoginLoadingState(): |
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
abstract class LoginState {} | |
class LoginLoadingState extends LoginState{} | |
class LoginSuccessState extends LoginState{} | |
class LoginFailureState extends LoginState{} | |
class LoginRedirectState extends LoginState{} // added now | |
void handleLoginState(LoginState state) { | |
switch(state) { | |
case LoginLoadingState(): |
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
abstract class LoginState {} | |
class LoginLoadingState extends LoginState{} | |
class LoginSuccessState extends LoginState{} | |
class LoginFailureState extends LoginState{} | |
void handleLoginState(LoginState state) { | |
switch(state) { | |
case LoginLoadingState(): | |
print('Logging in...'); // Handle loading state |
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
class Website { | |
const Website(this.url); | |
final String url; | |
} | |
void main() { | |
final Website website = Website("Stackoverflow"); | |
print(website == Website("Stackoverflow")); // Prints false | |
} |
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 pandas as pd | |
from sqlalchemy import create_engine | |
# follows django database settings format, replace with your own settings | |
DATABASES = { | |
'production':{ | |
'NAME': 'dbname', | |
'USER': 'user', | |
'PASSWORD': 'pass', | |
'HOST': 'rdsname.clqksfdibzsj.us-east-1.rds.amazonaws.com', |
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 java.lang.annotation.*; | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target(ElementType.TYPE) | |
@Inherited | |
@interface Deletable { | |
} | |
@Deletable | |
class Entity { |
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
interface Deletable { | |
} | |
class Entity implements Deletable { | |
// implementation details | |
} | |
class ShapeDao extends Entity { | |
// other dao methods | |
public boolean delete(Object object) { |
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
# Search "Startup Applications" in App launcher | |
# Under name: Auto Screenshot Taker | |
# Under Command: /usr/bin/python3 /home/ajinkya/Documents/Ajinkya/Freelancing/screenshots.py | |
# Under Comment: Auto Screenshot Taker | |
# Now the script | |
# import py auto gui |
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
<%@ page language="java" contentType="text/html; charset=UTF-8" | |
pageEncoding="UTF-8"%> | |
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Insert title here</title> | |
<style> | |
.inp-field { |
NewerOlder