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 middy, { MiddlewareObj } from '@middy/core' | |
import httpErrorHandler from '@middy/http-error-handler' | |
import httpHeaderNormalizer from '@middy/http-header-normalizer' | |
import httpJsonBodyParser from '@middy/http-json-body-parser' | |
import { APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2, Handler } from 'aws-lambda' | |
import { zodValidator } from 'middy-zod-validator' | |
import { ZodSchema, z, infer as ZInfer } from 'zod' | |
import { isHttpError } from 'http-errors' |
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
char *myCharacters[3] = { "TomJohn", "George", "Charles Condomine" }; | |
qsort_b(myCharacters, 3, sizeof(char *), ^(const void *l, const void *r) { | |
char *left = *(char **)l; | |
char *right = *(char **)r; | |
return strncmp(left, right, 1); | |
}); | |
// myCharacters is now { "Charles Condomine", "George", "TomJohn" } |
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
,"k_0",0,"234" | |
,"k_1",1,"380" | |
,"k_2",2,"120" | |
,"k_3",3,"53" | |
,"k_4",4,"162" | |
,"k_5",5,"13" | |
,"k_6",6,"156" | |
,"k_7",7,"231" | |
,"k_8",8,"418" | |
,"k_9",9,"332" |
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
<!DOCTYPE html> | |
<HTML xmlns="http://www.w3.org/1984/microsoft/macintosh/"> | |
<TITLE>Windows 8</TITLE> | |
<TABLE><TR><TD> | |
<BLINK>Tile 1</BLINK> | |
<BLINK>Tile 2</BLINK> | |
<BLINK>Tile 3</BLINK> | |
</TD></TR><TR><TD> | |
<BLINK>Tile 4</BLINK> | |
<BLINK>Tile 5</BLINK> |
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
{ | |
graphitePort: 2003 | |
, graphiteHost: "localhost" | |
, port: 8125 | |
, debug: true | |
, debugInterval: 10000 | |
, dumpMessages: true | |
, flushInterval: 10000 | |
} |
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 nocompatible " be iMproved | |
filetype off " required! | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" My Bundles | |
" GitHub | |
Bundle 'gmarik/vundle' | |
Bundle 'tpope/vim-fugitive' | |
Bundle 'tpope/vim-markdown' | |
" vim-scripts |
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
# TO_FOLDER=/something | |
# FROM=/your-es-installation | |
DATE=`date +%Y-%m-%d_%H-%M` | |
TO=$TO_FOLDER/$DATE/ | |
echo "rsync from $FROM to $TO" | |
# the first times rsync can take a bit long - do not disable flusing | |
rsync -a $FROM $TO | |
# now disable flushing and do one manual flushing |
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 http://asemanfar.com/Current-Git-Branch-in-Bash-Prompt | |
c_cyan=`tput setaf 6` | |
c_red=`tput setaf 1` | |
c_green=`tput setaf 2` | |
c_sgr0=`tput sgr0` | |
parse_git_branch () | |
{ | |
if git rev-parse --git-dir >/dev/null 2>&1 | |
then |
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
class LazyDict(dict): | |
def __getattr__(self, attr): | |
if attr in self: | |
return self[attr] | |
return None | |
def __setattr__(self, attr, value): | |
self[attr] = value | |
TypeError |
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
tell application "System Events" | |
tell application "Google Chrome" to activate | |
keystroke "a" using {command down, shift down} | |
end tell |
NewerOlder