Skip to content

Instantly share code, notes, and snippets.

Avatar
🚧
WIP

Bayu Aldi Yansyah pyk

🚧
WIP
View GitHub Profile
View transition_prob_jokowi.log
P(di|jokowi) = 0.07768
P(dan|jokowi) = 0.07121
P(yang|jokowi) = 0.03387
P(-|jokowi) = 0.02851
P(juga|jokowi) = 0.02798
P(akan|jokowi) = 0.02315
P(untuk|jokowi) = 0.01838
P(saat|jokowi) = 0.01520
P(dalam|jokowi) = 0.01455
P(itu|jokowi) = 0.01343
@pyk
pyk / index.md
Created Sep 15, 2018 — forked from rstacruz/index.md
Rails models cheatsheet
View index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to
has_one
@pyk
pyk / app.js
Last active Jul 31, 2018
app.js
View app.js
// Models is sequelize instance
app.use('/smartphones', smartphonesRouter(models));
View SketchSystems.spec
Katalog CMS*
Home Page*
User Click About Link -> About Page
User click login button and success -> Dashboard Page
User click login button and failed -> Unauthorized Page
Dashboard Page
User Click Logout Button -> Home Page
User click create new category button -> New Category Page
View elasticsearch-statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: elasticsearch
labels:
service: elasticsearch
spec:
serviceName: es
# NOTE: This is number of nodes that we want to run
# you may update this
View npm-init-defaults
npm config set init.author.name "Bayu Aldi Yansyah"
npm config set init.author.email bayualdiyansyah@gmail.com
npm config set init.author.url https://github.com/pyk
npm config set init.license MIT
@pyk
pyk / app-request-rate.py
Created Apr 1, 2018
sanic-instrumentation-guide
View app-request-rate.py
# app.py
import asyncio
import random
from sanic import Sanic
from sanic import response
import prometheus_client as prometheus
app = Sanic()
@pyk
pyk / app.py
Last active Apr 1, 2018
sanic-instrumentation-guide
View app.py
# app.py
import asyncio
import random
from sanic import Sanic
from sanic import response
app = Sanic()
@app.get("/")
async def index(request):
View first.pyde
CANVAS_HEIGHT = 600
CANVAS_WIDTH = 600
FPS = 15
def setup():
"""Setup the canvas"""
# Canvas size
size(CANVAS_HEIGHT, CANVAS_WIDTH, P3D)
# Draw from center
View spirals.pde
// 'spirals' by dave
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
You can’t perform that action at this time.