Skip to content

Instantly share code, notes, and snippets.

View somat's full-sized avatar
🏠
Working from home

Akhmat Safrudin somat

🏠
Working from home
View GitHub Profile
@somat
somat / nginx.conf
Last active August 29, 2015 14:05
Nginx Configuration for Codeigniter
server {
listen 80 default_server;
server_name dev.example.com;
location / {
root /usr/share/nginx/html;
index index.php index.html;
}
location /exampleci/ {
@somat
somat / Gruntfile.js
Created August 18, 2014 22:20
Gruntfile for AngularJS
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
all: ['public/src/js/**/*.js']
},
uglify: {
@somat
somat / nodeappinit.sh
Last active August 29, 2015 14:05
Redhat init script for managing a NodeJS app via forever
#!/bin/sh
##
## Redhat / Linux / LSB
##
# chkconfig: 345 85 15
# description: Startup script for Express / Node.js application with the \
## forever module.
##
## A modification of https://gist.github.com/thehunmonkgroup/2042409
##
@somat
somat / nginx.conf
Created January 26, 2015 10:00
Nginx configuration for reverse proxy
server {
listen 80;
server_name domain.com;
location / {
proxy_pass http://localhost:8090/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
This script set ownership for all table, sequence and views for a given database
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto
@somat
somat / isauth.js
Created October 21, 2016 10:35
Auth middleware, set layout for authenticated user.
var isAuth = function(req, res, next) {
if(req.user) {
res.locals.layout = 'app';
next();
} else {
res.redirect(res.locals.url.login);
}
}
module.exports = isAuth;
@somat
somat / fedora_pptp
Created November 10, 2016 06:44
Enable PPTP on Fedora
firewall-cmd --direct --add-rule ipv4 filter INPUT 0 -p gre -j ACCEPT
firewall-cmd --direct --add-rule ipv6 filter INPUT 0 -p gre -j ACCEPT
firewall-cmd --reload
@somat
somat / docker_rm_all
Created November 12, 2016 09:08
Remove all Docker containers
$ docker rm $(docker ps -a -q)
"""Example RNN."""
from __future__ import print_function, division
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
num_epochs = 100
total_series_length = 50000
truncated_backprop_length = 15
state_size = 4
"""Example RNN."""
from __future__ import print_function, division
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
num_epochs = 100
total_series_length = 50000
truncated_backprop_length = 15
state_size = 4