Skip to content

Instantly share code, notes, and snippets.

View firhatsungkar's full-sized avatar

Muhamad Firhat firhatsungkar

View GitHub Profile
@firhatsungkar
firhatsungkar / Ubuntu Nodejs
Created May 17, 2016 04:26
Install Nodejs on Ubuntu
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
@firhatsungkar
firhatsungkar / gulpfile.js
Last active May 17, 2016 04:53
My Gulpfile
'use strict';
// Gulp Plugins
var gulp = require('gulp'),
sass = require('gulp-sass'),
livereload = require('gulp-livereload'),
autoprefixer = require('gulp-autoprefixer');
// Gulp Config
var input = 'scss/**/*.scss',
output = 'css',
sassConfig = {
@firhatsungkar
firhatsungkar / gulpfile.js
Created November 4, 2016 03:42
Gulp-Frontend
'use strict';
/**
* Gulp Requiretment
* @type {[type]}
*/
var gulp = require('gulp');
var pug = require('gulp-pug');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
<?php
class ThemosisValetDriver extends BasicValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
* @return bool
@firhatsungkar
firhatsungkar / AbstractFactory.js
Last active January 30, 2019 01:05
Javascript Design Pattern
class Vehicle {
constructor(color, wheels, state) {
if(this.constructor == Vehicle) throw new Error('Vehicle is abstarct class')
}
getColor() { throw new Error('getColor must be emplemented')}
getWheels() { throw new Error('getWheels must be emplemented')}
getState() { throw new Error('getState must be emplemented')}
}
class Car extends Vehicle {
@firhatsungkar
firhatsungkar / 01.js
Created February 20, 2019 08:07
js-array-object-challange
const makanan = [
'Sate dan Nasi',
'Nasi Goreng',
'Mie Rebus',
'Nasi Bakar',
'Tempe Goreng',
'Mie Goreng',
'Ikan Bakar',
'Nasi Uduk',
'Kerupuk',

Python Cheat Sheet

Dependency in Python

  • virtualenv venv -p /usr/local/bin/python3
  • source ./venv/bin/activate
  • pip freeze > requirements.txt
  • pip install -r requirements.txt
@firhatsungkar
firhatsungkar / node_nginx_ssl.md
Created September 26, 2019 22:26 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@firhatsungkar
firhatsungkar / ssh.md
Created September 26, 2019 22:27 — forked from bradtraversy/ssh.md
SSH & DevOps Crash Course Snippets

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh brad@192.168.1.29

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

@firhatsungkar
firhatsungkar / mousemove.ps1
Created March 24, 2020 05:27 — forked from MatthewSteeples/mousemove.ps1
Powershell Script to keep the mouse moving
Add-Type -AssemblyName System.Windows.Forms
while ($true)
{
$Pos = [System.Windows.Forms.Cursor]::Position
$x = ($pos.X % 500) + 1
$y = ($pos.Y % 500) + 1
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)
Start-Sleep -Seconds 10
}