Want to fork your own gists? No fork button? No problem! Install this user script by clicking refork.user.js' "raw" link down below: ⇓
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- google's material design colours from | |
http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
<!--reds--> | |
<color name="md_red_50">#FFEBEE</color> | |
<color name="md_red_100">#FFCDD2</color> | |
<color name="md_red_200">#EF9A9A</color> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
/* https://www.techbeamers.com/sql-query-questions-answers-for-practice/#sql-queries */ | |
/*Q-1*/ | |
select first_name as worker_name from worker; | |
/*Q-2*/ | |
Select upper(FIRST_NAME) from Worker; | |
/*Q-3*/ | |
SELECT distinct department FROM worker; |
Docker is available for Linux, MacOS, and Windows.
Docker for Mac is best installed with Homebrew and Homebrew Cask. For other ways to install on MacOS, see Install Docker for Mac in Docker's docs.
brew cask install docker # Install Docker
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
from rest_framework.views import APIView | |
from rest_framework.response import Response | |
from rest_framework.mixins import UpdateModelMixin, DestroyModelMixin | |
from .models import Todo | |
from .serializers import TodoSerializer | |
class TodoListView( | |
APIView, # Basic View class provided by the Django Rest Framework |
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
#------------------------------------------- | |
#------------Simple Linked List------------- | |
#------------------------------------------- | |
# Node Class | |
class Node: | |
def __init__(self, data): | |
self.data = data | |
self.link = None | |
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
#!/bin/sh | |
# | |
# Delete Python's compiled *.pyc and __pycache__ files like a pro | |
# https://gist.github.com/jakubroztocil/7892597 | |
# | |
# Usage: | |
# Delele *.pyc and __pycache__ files recursively in the current directory: | |
# $ pyc | |
# | |
# The same, but under /path: |
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
from django import forms | |
from django.contrib.auth.models import User | |
class SignupForm(forms.ModelForm): | |
username = forms.CharField(max_length=100) | |
first_name = forms.CharField(max_length=100) | |
last_name = forms.CharField(max_length=100) | |
password = forms.CharField(max_length=100) | |
email = forms.CharField(max_length=100) |
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
#!/bin/bash -ex | |
# NOTE: ANDROID_HOME must be configured as an environment variable. | |
# Kill all the existing adb servers and start over a new adb server. | |
function restart_adb_server() { | |
echo "********************* Restarting adb ... *********************" | |
adb kill-server | |
sleep 2 | |
adb start-server | |
sleep 2 |