Skip to content

Instantly share code, notes, and snippets.

View daimagine's full-sized avatar

Adi Kurniawan daimagine

  • Bogor
View GitHub Profile
@daimagine
daimagine / atur schedule.md
Last active January 2, 2020 05:00
narasi.md
  • pilih tanggal kemudian pilih salah satu job yang ada di list bagian tengah
  • detail pekerjaan akan muncul di bagian kanan layar
  • untuk menugaskan pekerja ke job tersebut, gunakan tombol biru (assign employee)
  • pekerja-pekerja ini yang akan mendapatkan reminder berupa notifikasi via aplikasi Telegram
  • di dalam detail job bisa ditambahkan tugas-tugas kecil (tasks)
  • gunakan input text di bagian bawah task, isi keterangan tugas kecil kemudian tekan Enter
import CodePush from 'react-native-code-push';
import {useStoreActions, useStoreState} from 'easy-peasy';
import React, {useEffect, useState, useCallback} from 'react';
import {showInfoToast} from '@ag/lib/toast';
export default () => {
const [syncMessage, setMessage] = useState('');
const [progress, setProgress] = useState(true);

How to Download iOS Simulator (Xcode) in Command Line and Install it

For faster connection speed and more flexibility.

Steps

  1. Start Xcode in command line by running this in commandline /Applications/Xcode.app/Contents/MacOS/Xcode
  2. Start downloading of the simulator
  3. Cancel it. YES CANCEL IT!
  4. You will get a message like this:
@daimagine
daimagine / download-blob.js
Created April 15, 2019 06:12
Download file from API blob result
// 'download-blob.js', inspired by this gist:
// 'dreamyguy/downloadFile.js' https://gist.github.com/dreamyguy/6b4ab77d2f118adb8a63c4a03fba349d
// I added some handler to make it works in Chrome, Safari, and Firefox on iOS
const downloadBlob = (
result,
defaultFilename = 'content.dat',
mime = 'application/octet-stream'
) => {
if (window && result && result.data) {
@daimagine
daimagine / git-aliases.md
Created May 15, 2018 01:35 — forked from EQuimper/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@daimagine
daimagine / nginx.conf
Created March 21, 2018 01:10 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@daimagine
daimagine / iterm2.md
Created January 11, 2017 06:44
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [
@daimagine
daimagine / iterm2-solarized.md
Created January 11, 2017 03:31 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@daimagine
daimagine / gist:c7938f81989e41ecfbadcdd6f113a0dc
Created November 9, 2016 21:26 — forked from tamoyal/gist:10441108
Create super user and database user in Mongo 2.6
# 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