Skip to content

Instantly share code, notes, and snippets.

View andhikamaheva's full-sized avatar
👨‍💻
Wired In

Andhika Maheva Wicaksono andhikamaheva

👨‍💻
Wired In
View GitHub Profile
@andhikamaheva
andhikamaheva / Changed Notifications on Text Field
Last active August 29, 2015 14:14
You can using this script to change required notification in text field
<form id="form" onsubmit="return(login())">
<input name="username" placeholder="Username" required title="Username Anda" oninvalid="this.setCustomValidity('Username harus diisi')"
onchange="this.setCustomValidity('')" type="text" />
<input name="pass" type="password" placeholder="Password" oninvalid="this.setCustomValidity('Password harus diisi')" onchange="this.setCustomValidity('')" required />
<br/>Remember me: <input type="checkbox" name="remember" value="true" /><br/>
<input type="submit" name="submit" value="Log In"/>

Keybase proof

I hereby claim:

  • I am andhikamaheva on github.
  • I am andhikamaheva (https://keybase.io/andhikamaheva) on keybase.
  • I have a public key whose fingerprint is F52C C3C6 530B 67BB 7AA2 68F2 0459 2934 5331 ADD4

To claim this, I am signing this object:

@andhikamaheva
andhikamaheva / auto_installer.sh
Created October 8, 2016 16:20
Script to Install Nginx, PHP 7, MariaDB Centos 7
#!env bash
doInstallServer(){
if [[ -e /etc/redhat-release ]]; then
RELEASE_RPM=$(rpm -qf /etc/centos-release)
RELEASE=$(rpm -q --qf '%{VERSION}' ${RELEASE_RPM})
if [ ${RELEASE} != "7" ]; then
echo "Bukan CentOS Release 7."
exit 1
fi
else
@andhikamaheva
andhikamaheva / client.html
Created November 24, 2017 01:05 — forked from agrueneberg/client.html
HMAC-SHA256 example for verifying both the data integrity and the authentication of a request in Node.js and web browsers.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HMAC-SHA256 Example</title>
</head>
<body>
<script src="http://crypto.stanford.edu/sjcl/sjcl.js"></script>
<script>
var sharedSecret, query, signature, hmac, xhr;
@andhikamaheva
andhikamaheva / solution_codility_demo_test.js
Created July 2, 2018 06:12
Codility Demo Test Exercise Solution (JavaScript/NodeJS)
// you can write to stdout for debugging purposes, e.g.
// console.log('this is a debug message');
function solution(A) {
// write your code in JavaScript (Node.js 8.9.4)
let tmp = []
for (let i = 0; i < A.length; i++) {
if (0 <= A[i]) {
tmp[A[i]] = true
@andhikamaheva
andhikamaheva / solution_codility_binarygap.js
Created July 2, 2018 06:23
Codility BinaryGap Exercise Solution (JavaScript/NodeJS)
// you can write to stdout for debugging purposes, e.g.
// console.log('this is a debug message');
function solution(N) {
// write your code in JavaScript (Node.js 8.9.4)
let binary = (N >>> 0).toString(2);
let totalGaps = []
let tmp = 0
for (let i = 0; i < binary.length; i++) {
@andhikamaheva
andhikamaheva / solution_codility_cyclicrotation.js
Created July 2, 2018 06:42
Codility CyclicRotation Exercise Solution (JavaScript/NodeJS)
// you can write to stdout for debugging purposes, e.g.
// console.log('this is a debug message');
function solution(A, K) {
// write your code in JavaScript (Node.js 8.9.4)
if (A.length === K || K === 0) {
return A
} else if (A.length === 0) {
return []
@andhikamaheva
andhikamaheva / solution_codility_oddoccurrencesinarray.js
Created July 2, 2018 08:54
Codility OddOccurrencesInArray Exercise Solution (JavaScript/NodeJS)
// you can write to stdout for debugging purposes, e.g.
// console.log('this is a debug message');
function solution(A) {
// write your code in JavaScript (Node.js 8.9.4)
let result = 0
for (let i = 0; i < A.length; i++) {
result ^= A[i]
}
@andhikamaheva
andhikamaheva / solution_codility_frogjmp.js
Created July 3, 2018 03:25
Codility FrogJmp Exercise Solution (JavaScript/NodeJS)
// you can write to stdout for debugging purposes, e.g.
// console.log('this is a debug message');
function solution(X, Y, D) {
// write your code in JavaScript (Node.js 8.9.4)
if (X >= Y) {
return 0
} else if (X === Y) {
return 0
@andhikamaheva
andhikamaheva / solution_codility_permmissingelem.js
Created July 3, 2018 03:53
Codility PerMissingElem Exercise Solution (JavaScript/NodeJS)
// you can write to stdout for debugging purposes, e.g.
// console.log('this is a debug message');
function solution(A) {
// write your code in JavaScript (Node.js 8.9.4)
A.sort(function (a,b) {
return a - b
})
let result = 1