Skip to content

Instantly share code, notes, and snippets.

View zackad's full-sized avatar

zackad

View GitHub Profile
@zackad
zackad / rakitan-sorfil.user.js
Created February 24, 2017 14:21
Rakitan.com table sorter and filter.
// ==UserScript==
// @name Rakitan.com Sorter & Filter
// @namespace zackad's script
// @description Sorting and filter entry on rakitan.com
// @include http://rakitan.com/kategori.php?*
// @version 0.1.0
// @grant none
// ==/UserScript==
$(document).ready(function(){
@zackad
zackad / Dockerfile
Created February 4, 2017 14:29 — forked from herloct/Dockerfile
Dockerfile for OL-Fetish
FROM alpine:3.5
ENV OPENLAYERS_VERSION=3.20.1
RUN apk update --no-cache \
&& apk add --no-cache \
nodejs \
openjdk8 \
&& mkdir -p /openlayers \
# uninstall all npm module inside node_modules
# credit goes to http://stackoverflow.com/a/24396148/6265296
npm uninstall `ls -1 node_modules | tr '/\n' ' '`
@zackad
zackad / ogr2ogr.sh
Last active March 9, 2021 20:03
ogr2ogr cheatsheet
# export mysql database into shapefile
ogr2ogr out_shapes MYSQL:gis,user=root,password=password
# import shapefile into mysql
ogr2ogr -f MySQL MySQL:database_name,user=root,password=password my_shapefile.shp -nln table_name -a_srs EPSG:4326 -update -overwrite -lco engine=MYISAM
# reproject spatial reference from WGS 84 UTM 48S to Geographic Lattitide/Longitude Coordinate System
ogr2ogr -f "ESRI Shapefile" target_file.shp source_file.shp -s_srs EPSG:32748 -t_srs EPSG:4326
Sub SplitWorkbook()
'Updateby20140612
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim xWs As Worksheet
Dim xWb As Workbook
Dim FolderName As String
Application.ScreenUpdating = False
Set xWb = Application.ThisWorkbook
DateString = Format(Now, "yyyy-mm-dd hh-mm-ss")
@zackad
zackad / simplify.js
Created August 19, 2016 11:33
Simplify polyline points with Douglas Peuker Algorithm
/**
* Simplifiying polyline points on Lattitide/Longitude format with Douglas Peuker Algorithm
* original version 'http://www.bdcc.co.uk/Gmaps/GDouglasPeuker.js'
*
* @param {array} LatLngLiteral with number
* @param {number} Tolerance of distance in meter
* @return {array} Simplified result
*/
function simplify (source, kink) {
var n_source, n_stack, n_dest, start, end, i, sig;
@zackad
zackad / fn_str_random_lipsum.sql
Last active June 26, 2024 06:09
Function to generate random text of lorem ipsum in MySQL.
/**
* ALL CREDIT GOES TO ORIGINAL CREATOR
* @Ronald Speelman
* http://moinne.com/blog/ronald/mysql/mysql-lorum-ipsum-generator
*
* renamed function for simplicity
*/
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='STRICT_TRANS_TABLES';
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url("https://simtrans.zackad.tk/layanan") {
#map{
width: 4000px !important;
height: 3000px !important;
float: left;
}
#map .map_container{
@zackad
zackad / street-view-control-hider.css
Last active December 11, 2015 10:15
Hide Google Street View Controller
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("google.com"), domain("google.co.id") {
#titlecard, .widget-runway-thumbstrip-background, .widget-runway-background-filler.widget-runway-background-filler-many, .widget-runway-growable, .scene-footer-container, #minimap, .app-viewcard-strip, #watermark{
display: none !important;
}
}
<style>
#olahan{
width: 800px;
}
textarea{
width: 800px;
}
</style>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<textarea name="text" onfocus="initiate()"></textarea>