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
package main | |
import ( | |
"fmt" | |
"regexp" | |
"strings" | |
) | |
func main() { | |
//mat3 := regexp.MustCompile(`[a-zA-Z0-9]`) |
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
package handlers_test | |
import ( | |
"bytes" | |
"context" | |
"encoding/json" | |
"fmt" | |
"net/http" | |
"net/http/httptest" | |
"reflect" |
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
// GroupByUserAndType : grouping cashback by userId and type | |
func (service *App) GroupByUserAndType(ctx context.Context, params ...QueryFilter) ([]*SumCashback, error) { | |
queryable, ok := data.QueryableFromContext(ctx) | |
if !ok { | |
queryable = service.queryable | |
} | |
where, args := BuildFilter(params...) | |
statement := fmt.Sprintf(` | |
SELECT "userId", SUM(amount) AS "amount", "type" | |
FROM "%s" %s GROUP BY "userId", "type"; |
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 golang:1.11-alpine as builder | |
WORKDIR /myapp | |
COPY go.mod . | |
COPY go.sum . | |
RUN apk add --no-cache ca-certificates git | |
# Get dependancies - will also be cached if we won't change mod/sum | |
RUN go mod download |
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
{ | |
"name": "sha224_tester", | |
"version": "1.0.0", | |
"description": "", | |
"author": "Alvian Rahman Hanif", | |
"private": true, | |
"scripts": { | |
"postinstall": "npm install express" | |
} | |
} |
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
const key = 3 | |
const offset = 2 | |
// setup arrays as mush as key in one table | |
const setupTable = (table, key) => { | |
for (let i = 0; i < key; i++) { | |
table.push([]) | |
} | |
} |
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
const column = 5 | |
export const encrypt = (text) => { | |
let token = text.split('') | |
let rows = token.length / column | |
let result = '' | |
for (let i = 0; i < column; i++) { | |
for (let j = 0; j < rows; j++) { | |
if ((j * column) + i < (token.length)) { |
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
const possibleTokens = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^&*()_ +-=[]{}|;\'\\:",./<>?' | |
const shifter = 5 | |
// setup letters into a one line for each possible disk | |
const data = () => { | |
let val = [] | |
possibleTokens.split('').forEach((letter, index) => { | |
val.push(letter) | |
}) | |
return val | |
} |
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
ruby -rbundler/inline -e "gemfile(true) do; source 'https://rubygems.org/'; gem 'rails', '5.1.0.beta1'; end" |
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
const data = { | |
navbar: { | |
icon: 'assets/icon.png', | |
navs: ['Beranda','Tentang Kami', 'Pengumuman', 'Galeri', 'Videos', 'Kontak Kami'] | |
}, | |
video: [ | |
{ | |
url: "https://www.youtube.com/embed/wJAGy08EbJA" | |
}, | |
{ |
NewerOlder