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
set encoding=utf-8 | |
" set guifont=Monaco:h9 | |
" set guifont=CamingoCode:h10 | |
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline:h10:cANSI | |
set lines=50 columns=110 | |
set go-=T | |
if has('gui_running') | |
set background=dark | |
else | |
set background=dark |
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
# using pycrypto (2.3) | |
from Crypto.PublicKey import RSA | |
# generate(self, bits, randfunc=None, progress_func=None) method of Crypto.PublicKey.RSA.RSAImplementation instance | |
new_key = RSA.generate(bits=2048) | |
# exportKey(self, format='PEM') method of Crypto.PublicKey.RSA._RSAobj instance | |
# Export the RSA key. A string is returned | |
# with the encoded public or the private half |
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
from OpenSSL import crypto | |
from socket import gethostname | |
k = crypto.PKey() | |
k.generate_key(crypto.TYPE_RSA, 2048) # generate RSA key-pair | |
cert = crypto.X509() | |
cert.get_subject().C = "<country>" | |
cert.get_subject().ST = "<city>" |
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
" Load matchit.vim, but only if the user hasn't installed a newer version. | |
if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# '' | |
runtime! macros/matchit.vim | |
endif | |
let g:fuf_file_exclude = '\v\~$' | |
\ . '|\.(o|png|PNG|JPG|class|CLASS|jpg|exe|dll|bak|swp|pyc|pyo)$' | |
\ . '|(^|[/\\])\.(hg|git|bzr)($|[/\\])' | |
\ . '|(^|[/\\])venv[/\\]' |
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 <termios.h> | |
#include <stdio.h> | |
static struct termios old, new; | |
/* Initialize new terminal i/o settings */ | |
void initTermios(int echo) | |
{ | |
tcgetattr(0, &old); /* grab old terminal i/o settings */ | |
new = old; /* make new settings same as old settings */ |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
cmake_minimum_required(VERSION 2.8.9) | |
project (test_ncurses) | |
find_package(curses REQUIRED) | |
include_directories(${CURSES_INCLUDE_DIR}) | |
file(GLOB SOURCES "*.c") | |
add_executable(test_ncurses ${SOURCES}) |
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 <ncurses.h> | |
int main( void ) | |
{ | |
printf( "Hello Ncurses!\r\n" ); | |
getch( ); | |
return ( 0 ); | |
} |
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( void ) | |
{ | |
int i; | |
for ( i = 1; i <= 100; i++ ) | |
{ | |
if ( !(i % 3) ) | |
{ |
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" | |
#define ID_A 0x01 | |
#define ID_B 0x02 | |
int main() { | |
unsigned char type; | |
unsigned short result; | |
printf("size of unsigned char = %x\n", sizeof(unsigned char) ); |
OlderNewer