add a function to check if the grid has any completed lines, and if so, removes them from the grid
Sure, here's an implementation of a function to check for completed lines and remove them from the grid:
python
def remove_completed_lines(grid): completed_lines = [] for i in range(len(grid)): if all(grid[i]):
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
#!/bin/bash | |
# use tmux to output ping and tracepath to the same address on left and right panels or windows | |
# Pass the argument to the two scripts | |
HOST=$1 | |
tmux new-session \; split-window -h \; send-keys "ping -c 20 $HOST" C-m \; select-pane -t 0 \; send-keys "tracepath $HOST" C-m |
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
#!/bin/python | |
import pygame | |
import random | |
import unittest | |
# Define the size of the game window and the size of each block | |
WINDOW_WIDTH = 200 | |
WINDOW_HEIGHT = 600 |
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
Oct 27 14:22:21 machine-name syncthing[1002]: SIGQUIT: quit | |
Oct 27 14:22:21 machine-name syncthing[1002]: PC=0x460c21 m=0 sigcode=0 | |
Oct 27 14:22:21 machine-name syncthing[1002]: goroutine 0 [idle]: | |
Oct 27 14:22:21 machine-name syncthing[1002]: runtime.futex(0x1678168, 0x80, 0x0, 0x0, 0xc000000000, 0x7ffd00000000, 0x434db3, 0xc000052848, 0x7ffd7dcb1010, 0x40adff, ...) | |
Oct 27 14:22:21 machine-name syncthing[1002]: #011/usr/local/go/src/runtime/sys_linux_amd64.s:535 +0x21 | |
Oct 27 14:22:21 machine-name syncthing[1002]: runtime.futexsleep(0x1678168, 0x7ffd00000000, 0xffffffffffffffff) | |
Oct 27 14:22:21 machine-name syncthing[1002]: #011/usr/local/go/src/runtime/os_linux.go:44 +0x46 | |
Oct 27 14:22:21 machine-name syncthing[1002]: runtime.notesleep(0x1678168) | |
Oct 27 14:22:21 machine-name syncthing[1002]: #011/usr/local/go/src/runtime/lock_futex.go:151 +0x9f |
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
#!/bin/bash | |
# gets cookie for camera, and sets it for reverse proxy for ZM | |
read -sp "Please enter camera http login password\ | |
" PASSWORD | |
USER=diederik | |
# Do login | |
curl -v 'http://192.168.0.11/login.cgi' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0' -H 'Accept: */*' -H 'Accept-Language: en-ZA,en-GB;q=0.8,en-US;q=0.5,en;q=0.3' --compressed -H 'Content-Type: application/x-www-form-urlencoded' -H 'X-Requested-With: XMLHttpRequest' --data "username=$USER&password=$PASSWORD" --cookie-jar cookies.txt |
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
# PowerShell Editor Services Bootstrapper Script | |
# ---------------------------------------------- | |
# This script contains startup logic for the PowerShell Editor Services | |
# module when launched by an editor. It handles the following tasks: | |
# | |
# - Verifying the existence of dependencies like PowerShellGet | |
# - Verifying that the expected version of the PowerShellEditorServices module is installed | |
# - Installing the PowerShellEditorServices module if confirmed by the user | |
# - Creating named pipes for the language and debug services to use (if using named pipes) | |
# - Starting the language and debug services from the PowerShellEditorServices module |
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
# PowerShell Editor Services Bootstrapper Script | |
# ---------------------------------------------- | |
# This script contains startup logic for the PowerShell Editor Services | |
# module when launched by an editor. It handles the following tasks: | |
# | |
# - Verifying the existence of dependencies like PowerShellGet | |
# - Verifying that the expected version of the PowerShellEditorServices module is installed | |
# - Installing the PowerShellEditorServices module if confirmed by the user | |
# - Creating named pipes for the language and debug services to use (if using named pipes) | |
# - Starting the language and debug services from the PowerShellEditorServices module |
This file has been truncated, but you can view the full file.
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
eEarlyAllocBuffers(): consuming early alloc buffers with count 0 | |
11-14 11:52:38.796 488-5060/? D/QCameraHWI_Mem: void qcamera::QCameraMemory::traceLogAllocStart(size_t, int, const char*) : alloc E count=5 size=24256512 | |
11-14 11:52:38.796 488-5060/? E/QCameraHWI_Mem: void qcamera::QCameraMemory::traceLogAllocStart(size_t, int, const char*):StreamMemsize 24256512 | |
11-14 11:52:38.796 488-5060/? D/QCameraHWI_Mem: void qcamera::QCameraMemory::traceLogAllocStart(size_t, int, const char*) : alloc E count=5 size=24256512 | |
11-14 11:52:38.796 488-5060/? E/QCameraHWI_Mem: void qcamera::QCameraMemory::traceLogAllocStart(size_t, int, const char*):Memsize 24256512 | |
11-14 11:52:38.817 512-5029/? I/chatty: uid=1006(camera) mm-qcamera-daem expire 55 lines | |
11-14 11:52:38.853 1208-2435/? W/NetworkIdentity: Active mobile network without subscriber! | |
11-14 11:52:38.857 488-5060/? D/QCameraHWI_Mem: void qcamera::QCameraMemory::traceLogAllocEnd(size_t) : X | |
11-14 11:52:38.857 488-5060/? E/QCameraHWI_Mem: void qcamera::QCameraMemory::tr |
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
package com.example.yourapp; | |
import android.annotation.SuppressLint; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
import android.os.Build; | |
import android.security.KeyPairGeneratorSpec; | |
import android.security.keystore.KeyGenParameterSpec; | |
import android.security.keystore.KeyProperties; | |
import android.support.annotation.RequiresApi; |
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
{ | |
"//1": "describes your app and its dependencies", | |
"//2": "https://docs.npmjs.com/files/package.json", | |
"//3": "updating this file will download and update your packages", | |
"name": "git-commit-bot", | |
"version": "0.0.1", | |
"description": "Tweet random git commits!", | |
"main": "server.js", | |
"scripts": { | |
"start": "node server.js" |
NewerOlder