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
class InMemoryCache { | |
constructor() { | |
this._cache = {}; | |
this._timeouts = {}; | |
} | |
set(key, value, time) { | |
if (this._timeouts[key]) { | |
clearTimeout(this._timeouts[key]); | |
delete this._timeouts[key]; |
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/sh | |
# If a command fails then the deploy stops | |
set -e | |
printf "\033[0;32mDeploying updates to GitHub...\033[0m\n" | |
# Build the project. | |
hugo -t mem # if using a theme, replace with `hugo -t <YOURTHEME>` |
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
# Add environment variable NDK_ROOT for cocos2d-x | |
export NDK_ROOT=/Users/hekumar/game-ex/frmlib/android-ndk-r9d | |
export PATH=$NDK_ROOT:$PATH | |
# Add environment variable ANDROID_SDK_ROOT for cocos2d-x | |
export ANDROID_SDK_ROOT=/Users/hekumar/Library/Android/sdk | |
export PATH=$ANDROID_SDK_ROOT:$PATH | |
export PATH=$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools:$PATH | |
# Add environment variable ANT_ROOT for cocos2d-x |
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
ZSH_DISABLE_COMPFIX="true" | |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-zsh is loaded. | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes |
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
""""""""""""""""" | |
"Vundle | |
"""""""""""""""" | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=$HOME/.vim/bundle/Vundle.vim |
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
1 $ git config --global url."[email protected]:".insteadOf "https://bitbucket.org/" |
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 | |
set -e | |
DISTRIBUTION_ID=E6VHHP64I3KLD | |
#list all invlaidations | |
aws cloudfront list-invalidations --distribution-id $DISTRIBUTION_ID |
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 | |
set -e | |
DISTRIBUTION_ID=E6VHHP64I3KLD | |
BUCKET_NAME=hemc.io-cdn | |
# Copy over pages - not static js/img/css/downloads | |
aws s3 sync --acl "public-read" --sse "AES256" public/ s3://$BUCKET_NAME --exclude 'post' | |
# Invalidate root page and page listings |
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 | |
# delete everything in public except .git | |
find public -path public/.git -prune -o -exec rm -rf {} \; 2> /dev/null | |
# Build a fresh copy | |
hugo -v |
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
{ | |
"name": "hemcio", | |
"version": "1.0.0", | |
"description": "hemc blog", | |
"scripts": { | |
"start": "hugo server -w -v --buildDrafts", | |
"build": "./build_site.sh", | |
"deploy": "./deploy_site.sh", | |
"deploystatus":"./deploystatus.sh" | |
}, |
NewerOlder