Skip to content

Instantly share code, notes, and snippets.

View anoochit's full-sized avatar

Anuchit Chalothorn anoochit

View GitHub Profile
@anoochit
anoochit / node-red-blink.js
Created November 2, 2014 05:01
node-red-blink
#include <SPI.h>
#include <Ethernet.h>
#include <PubSubClient.h>
#include "DHT.h"
// Update these with values suitable for your network.
byte mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED };
byte server[] = { 192, 168, 0, 104 };
byte ip[] = { 192, 168, 0, 105 };
@anoochit
anoochit / Dockerfile
Created November 26, 2014 15:31
fig sample dockerfile
FROM orchardup/python:2.7
ADD . /code
WORKDIR /code
RUN pip install -r requirements.txt
@anoochit
anoochit / requirements.txt
Created November 26, 2014 15:31
fig sample requirements.txt
flask
redis
@anoochit
anoochit / app.py
Created November 26, 2014 15:32
fig sample app.py
from flask import Flask
from redis import Redis
import os
app = Flask(__name__)
redis = Redis(host="redis_1", port=6379)
@app.route('/')
def hello():
redis.incr('hits')
return 'Hello World! I have been seen %s times.' % redis.get('hits')
@anoochit
anoochit / fig.yml
Created November 26, 2014 15:33
fig sample fig.yml
web:
build: .
command: python app.py
ports:
- "5000:5000"
volumes:
- .:/code
links:
- redis
redis:
@anoochit
anoochit / gist:9362004cdda6108b2b24
Created December 1, 2014 16:29
gitlab ci buildstep
git submodule update --init
ls -la
ID=dumpapp-$(date +"%Y%m%d%H%M%S")
echo "Start building image..." $ID
docker build -t index.fffee.org/$ID .
echo "Push image..."
docker push index.fffee.org/$ID
echo "Deploy image..."
docker -H tcp://index.fffee.org:2375 run -Pd index.fffee.org/$ID
CID=$(docker -H tcp://index.fffee.org:2375 ps -l -q)
@anoochit
anoochit / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
@anoochit
anoochit / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
@anoochit
anoochit / Dockerfile
Created December 5, 2014 15:16
2048 nodejs game
FROM ubuntu:12.04
RUN apt-get update
RUN apt-get install -y nginx zip curl
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN curl -o /usr/share/nginx/www/master.zip -L https://codeload.github.com/gabrielecirulli/2048/zip/master
RUN cd /usr/share/nginx/www/ && unzip master.zip && mv 2048-master/* . && rm -rf 2048-master master.zip
EXPOSE 80