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
| "Use TAB to complete when typing words, else inserts TABs as usual. | |
| function! Tab_Or_Complete() | |
| if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w' | |
| return "\<C-N>" | |
| else | |
| return "\<Tab>" | |
| endif | |
| endfunction | |
| inoremap <Tab> <C-R>=Tab_Or_Complete()<CR> |
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
| " use Ctrl+L to toggle the line number counting method | |
| function! g:ToggleNuMode() | |
| if &nu == 1 | |
| set rnu | |
| else | |
| set nu | |
| endif | |
| endfunction | |
| nnoremap <silent><C-L> :call g:ToggleNuMode()<cr> |
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
| // Implement a post-fix calculator using a stack. | |
| #include<stdio.h> | |
| #include<stdlib.h> | |
| #include<stdbool.h> | |
| #include<string.h> | |
| #define MAX_ELEMENTS 100 | |
| #define ROGUE_VALUE -99999 | |
| typedef int stackdata_t; | |
| typedef struct{ |
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 | |
| # Our ghetto auto-testish thing. User presses any key to test, | |
| # Ctrl-C to get out. Make this file executable, place in your path, and run in | |
| # your Ruby project's directory. Assumes your tests are located in spec/ | |
| # Technically 100% more convenient than up+enter! ;) | |
| function hold(){ | |
| read -n 1 -s | |
| } | |
This file has been truncated, but you can view the full file.
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
| Starting program: /Users/jmccullough/Sites/github/mruby/bin/mrbc -c /web/github/mrbc-playground/rubyfile.rb | |
| Reading symbols for shared libraries +. done | |
| Program received signal EXC_BAD_ACCESS, Could not access memory. | |
| Reason: KERN_PROTECTION_FAILURE at address: 0x00007fff5f3ffff8 | |
| 0x00000001000340f3 in sym_hash_func (mrb=0x100800000, s=Cannot access memory at address 0x7fff5f3ffff8 | |
| ) at symbol.c:22 | |
| 22 { | |
| #0 0x00000001000340f3 in sym_hash_func (mrb=0x100800000, s=Cannot access memory at address 0x7fff5f3ffff8 | |
| ) at symbol.c:22 |
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
| (Precise)~/lab/c$ gcc -std=c99 -Wall ex2.c -o ex2.o | |
| ex2.c: In function ‘splitString’: | |
| ex2.c:4:5: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration] | |
| ex2.c:4:15: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default] | |
| ex2.c:10:9: warning: implicit declaration of function ‘isdigit’ [-Wimplicit-function-declaration] | |
| ex2.c:25:5: warning: implicit declaration of function ‘sprintf’ [-Wimplicit-function-declaration] | |
| ex2.c:25:5: warning: incompatible implicit declaration of built-in function ‘sprintf’ [enabled by default] | |
| ex2.c:25:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘char (*)[40]’ [-Wformat] | |
| ex2.c:26:5: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] | |
| ex2.c:26:5: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default] |
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
| # Redirect everything to the main site. | |
| server { | |
| server_name www.mysite.com; | |
| return 301 http://mysite.com$request_uri; | |
| } | |
| server { | |
| server_name mysite.com; | |
| location / { try_files $uri @flaskapp; } | |
| location @flaskapp { |
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
| # Yay school. | |
| def find_largest(mylist): | |
| if len(mylist) == 1: | |
| return 0 | |
| elif len(mylist) == 2: | |
| if mylist[0] > mylist[1]: | |
| return 0 | |
| else: | |
| return 1 | |
| else: |
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
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #define BUFSIZE 80 | |
| int main(){ | |
| char *cwd1; | |
| char cwd2[BUFSIZE]; | |
| int result; | |
| // Get the current working directory. This is vulnerable to buffer |
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
| /* myfile.c */ | |
| #include<stdio.h> | |
| /* template.html */ | |
| <pre>{% include "myfile.c" %}</pre> | |