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 | |
ncol="\033[0m" | |
bold="\033[1m" | |
dim="\033[2m" | |
uline="\033[4m" | |
reverse="\033[7m" | |
red="\033[31m" | |
green="\033[32m" | |
yellow="\033[33m" | |
blue="\033[34m" |
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
+++ builtins/cd.def 2023-05-17 11:57:46.148180535 +0530 | |
@@ -328,6 +328,8 @@ | |
return (EXECUTION_FAILURE); | |
} | |
lflag = 0; | |
+ } else if (strcmp(list->word->word, "...") == 0){ | |
+ dirname = "../../"; | |
} | |
#if defined (CD_COMPLAINS) | |
else if (list->next) |
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
String[] perms = { | |
Manifest.permission.READ_EXTERNAL_STORAGE, | |
Manifest.permission.WRITE_EXTERNAL_STORAGE | |
}; | |
public void check_perms(){ | |
for (String perm: perms) { | |
if (ContextCompat.checkSelfPermission(this, perm) != PackageManager.PERMISSION_GRANTED) { | |
// request permission |
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
def IntToBin(num): | |
bin_str = "" | |
while num > 0: | |
if num % 2 == 0: # num is even | |
bin_str = "0" + bin_str | |
else: # num is odd | |
bin_str = "1" + bin_str | |
num -= 1 | |
num = num / 2 | |
return bin_str |
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 random | |
def jumble(words): | |
if not words: return | |
ret = [] | |
le = len(words) | |
for _ in range(le): | |
r = random.randint(0,le-1) | |
while words[r] in ret: | |
r = random.randint(0,le-1) | |
ret.append(words[r]) |