Skip to content

Instantly share code, notes, and snippets.

Working from home

Edi Santoso cyberid41

Working from home
Block or report user

Report or block cyberid41

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View updating-external-data-when-props-changes-using-promises.js
// This is an example of how to fetch external data in response to updated props,
// If you are using an async mechanism that does not support cancellation (e.g. a Promise).
class ExampleComponent extends React.Component {
_currentId = null;
state = {
externalData: null
cyberid41 / gmaps_3.html
Created Mar 20, 2018 — forked from opnchaudhary/gmaps_3.html
Get latitude and longitude from google maps
View gmaps_3.html
<!doctyp html>
<html lang="en">
<meta charset="utf-8" />
<title>Get Latitude and Longitude</title>
<script src=""></script>
<script src="//"></script>
cyberid41 / splice-object-array.js
Created Dec 22, 2017 — forked from scottopolis/splice-object-array.js
Remove object from array of objects in Javascript
View splice-object-array.js
// source:
// we have an array of objects, we want to remove one object using only the id property
var apps = [{id:34,name:'My App',another:'thing'},{id:37,name:'My New App',another:'things'}];
// get index of object with id:37
var removeIndex = { return; }).indexOf(37);
// remove object
apps.splice(removeIndex, 1);
cyberid41 / css-media-queries-cheat-sheet.css
Created Oct 20, 2017 — forked from bartholomej/css-media-queries-cheat-sheet.css
CSS Media Query Cheat Sheet (with Foundation)
View css-media-queries-cheat-sheet.css
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
cyberid41 /
Created Sep 28, 2017 — forked from kevin-smets/
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)





View marko.html
<!doctype html>
<title>Hello Marko</title>
<h1>My favorite colors</h1>
<li for(color in input.colors)>
View template.marko
<!doctype html>
title -- Hello Marko
h1 -- My favorite colors
li for(color in input.colors)
-- ${color}
View marko-test.js
class {
onCreate() {
this.state = { count:0 };
increment() {
style {
cyberid41 /
Created Apr 10, 2017 — forked from folivares/
Nginx configuration for Laravel 5.1

Nginx Server Blocks configuration to run more than one Laravel 5.1 web-app off of a single Linux server


  • PHP package: php5-fpm php5-mcrypt php5-mysql
  • Laravel 5.1
  • Nginx 1.8

Default Server Block

cyberid41 / gist:184b79e7b6d4eb83c4ecebd6a52c14e5
Created Mar 13, 2017 — forked from tamoyal/gist:10441108
Create super user and database user in Mongo 2.6
View gist:184b79e7b6d4eb83c4ecebd6a52c14e5
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
You can’t perform that action at this time.