Skip to content

Instantly share code, notes, and snippets.

Avatar

arief nur andono goldalworming

View GitHub Profile
View account_page_ubman.dart
import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
class AccountPage extends StatefulWidget {
@override
_AccountPageState createState() => _AccountPageState();
}
View gist:502818bf6b189ab369eb6aa49f54dcff
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec
View express_handleaxios.js
var express = require('express');
var app = express();
var Server = require('http').Server;
var server = new Server(app);
var cors = require('cors')
var port = 3131
app.options('*', cors())
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
View copyvalue_vue.js
// dari https://codepen.io/PJCHENder/pen/jamJpj?editors=1010
// masukan html ini
// <input type="hidden" id="idcopy" :value="copyval">
// <button class="absolute cursor-pointer" style="right:10px;top:100px;" @click="copyvalue()">tes</button>
copyValue () {
let testingCodeToCopy = document.querySelector('#idcopy')
testingCodeToCopy.setAttribute('type', 'text')
testingCodeToCopy.select()
@goldalworming
goldalworming / delay.js
Created Nov 21, 2018 — forked from eteeselink/delay.js
ES7 async/await version of setTimeout
View delay.js
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
async function something() {
console.log("this might take some time....");
await delay(5000);
console.log("done!")
}
something();
@goldalworming
goldalworming / index.html
Created Nov 18, 2018 — forked from tarruda/index.html
electron sandbox webview test
View index.html
<html>
<body>
<webview id="foo" allowpopups sandbox="true" preload="preload-webview.js" src="index.html" style="display:inline-flex; width:640px; height:480px"></webview>
<script type="text/javascript" charset="utf-8">
</script>
</body>
</html>
@goldalworming
goldalworming / mysql-docker.sh
Created Nov 7, 2018 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
View mysql-docker.sh
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@goldalworming
goldalworming / SystemInformation.vue
Created Oct 28, 2018
sample use async inside method vue
View SystemInformation.vue
<template>
<div>
<div class="title">Information</div>
<div class="items">
<div class="item">
<div class="name">Path:</div>
<div class="value">{{ path }}</div>
</div>
<div class="item">
<div class="name">Route Name:</div>
@goldalworming
goldalworming / facebook.py
Created Apr 29, 2018 — forked from phwd/facebook.py
Tornado example of posting to a page (Doesn't handle duplicate posts #506)
View facebook.py
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@goldalworming
goldalworming / activerecord-benchmarks.csv
Created Mar 4, 2018 — forked from epitron/activerecord-benchmarks.csv
CockroachDB vs PostgreSQL vs MySQL vs SQLite
View activerecord-benchmarks.csv
activerecord-cockroachdb activerecord-postgresql activerecord-mysql activerecord-sqlite Benchmark
9.216770* (60720k) 9.590111 (60984k) 12.455487 (69168k) 18.465701 (64944k) Model Object Creation: 3200 objects (No Transaction)
0.900417 (0k) 0.893337 (0k) 0.832904 (0k) 0.707108* (0k) Model Object Creation: 3200 objects (Transaction)
2.031437* (337128k) 2.070499 (336864k) 2.181665 (332112k) 2.215748 (333432k) Model Object Select: 6400 objects 64 times (No Transaction)
2.004822 (0k) 1.984105* (0k) 2.121498 (264k) 2.175031 (0k) Model Object Select: 6400 objects 64 times (Transaction)
3.460825 (0k) 3.337974 (0k) 3.875209 (0k) 2.622881* (0k) Model Object Select PK: 640 objects 64 times (No Transaction)
3.372082 (0k) 3.247312 (0k) 3.786783 (0k) 2.253132* (0k) Model Object Select PK: 640 objects 64 times (Transaction)
3.594136 (0k) 3.431209 (0k) 4.428752 (0k) 2.679963* (0k) Model Object Select Hash: 640 objects 64 times (No Transaction)
3.473371 (0k) 3.358583 (0k) 3.800874 (0k) 2.409768* (0k) Model Object Select Hash:
You can’t perform that action at this time.