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
ZSH_THEME_GIT_PROMPT_PREFIX="[%{$fg_bold[green]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}]" | |
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}*" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" | |
function prompt_char { | |
if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi | |
} | |
PROMPT='%(?, ,%{$fg[red]%}FAIL: $?%{$reset_color%} |
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
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE text/html | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE text/css | |
AddOutputFilterByType DEFLATE application/xml | |
AddOutputFilterByType DEFLATE application/xhtml+xml | |
AddOutputFilterByType DEFLATE application/rss+xml | |
AddOutputFilterByType DEFLATE application/javascript | |
AddOutputFilterByType DEFLATE application/x-javascript |
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
nums = [100, 13.2, 92.123, 0.124, 12] | |
ops = ['+','/','-','*'] | |
highest = 0 | |
eq = '' | |
highesteq = '' | |
perms = nums.to_a.permutation.map() | |
perm2 = ops.to_a.permutation.map() | |
perms.each{ | n | | |
perm2.each { | o | | |
eq = '' |
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
# 3 x 3 grid, has 1 3*3, 4 2*2, 9 1*1 | |
# the easy way to calculate this is to subtract the number you need from the width | |
# so 2 x 2 in a 3 x 3 grid would be (3 -(2-1)) * (3 -(2-1)) = 4 | |
gridSize = 9 | |
total = 0 | |
# first we start with the smallest square and go up to the widest square | |
for x in range(1,gridSize+1): | |
if x ==1: | |
total = total + (gridSize * gridSize) |
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
#include<stdio.h> | |
int main() | |
{ | |
int n, i = 3, x, c; | |
printf("Enter the start number\n"); | |
scanf("%d",&c); | |
printf("Enter the last number\n"); | |
scanf("%d",&n); |
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
#include<stdio.h> | |
#include<math.h> | |
int main() | |
{ | |
int n, i = 3, x, c; | |
char prime; | |
printf("Enter the number of prime numbers required\n"); | |
scanf("%d",&c); | |
printf("Enter the last number\n"); |
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
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[cyan]%}[" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="" | |
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch | |
git_custom_status() { | |
local cb=$(current_branch) | |
if [ -n "$cb" ]; then | |
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX" |
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 allowed_file(filename): | |
allowed = app.config['ALLOWED_EXTENSIONS'] | |
return '.' in filename and filename.rsplit('.', 1)[1] in allowed | |