Skip to content

Instantly share code, notes, and snippets.

View devyfriend's full-sized avatar

devyfriend

View GitHub Profile
@devyfriend
devyfriend / emoji.md
Last active November 14, 2023 07:33 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@devyfriend
devyfriend / +layout.server.js
Last active May 4, 2023 19:05
cheatsheet of sveltekit
export async function load(dd) {}
/*
+layout.server load {
cookies: {
get: [Function: get],
getAll: [Function: getAll],
set: [Function: set],
delete: [Function: delete],
serialize: [Function: serialize]
@devyfriend
devyfriend / ssl.conf
Created January 31, 2022 05:08
letsencrypt nginx ubuntu
sudo certbot certonly --manual --server https://acme-v02.api.letsencrypt.org/directory --preferred-challenges dns-01 -d "*.domain.id"
update dns txt name: _acme-challenge -> value from step 1
update nginx.conf to file .pem -> path from step 1
valid for 90 days
@devyfriend
devyfriend / summernote_plugins.js
Created January 10, 2022 04:45
Summernote plugin
$.extend(true, $.summernote.lang, {
"en-US": {
/* US English(Default Language) */
linkPlugin: {
exampleText: "Example Text",
dialogTitle: "Example Plugin",
okButton: "OK",
},
},
});
@devyfriend
devyfriend / openssl.cnf
Last active August 23, 2020 00:15
ssl certificate - one for all
#usage: openssl req -config openssl.cnf -new -x509 -days 825 -out localhost.crt
==============================================================================================================================
#file: openssl.cnf
[ req ]
default_bits = 2048
default_keyfile = localhost.key
default_md = sha256
default_days = 825
@devyfriend
devyfriend / gulpfile.js
Last active May 7, 2020 07:47
gulp browserify babelify
const spawn = require("child_process").spawn;
const gulp = require( 'gulp' );
const babel = require( 'gulp-babel' );
const babelify = require("babelify");
const browserify = require("browserify");
const source = require( "vinyl-source-stream" );
const buffer = require( 'vinyl-buffer' );
const uglify = require( 'gulp-uglify' );
function reload ()
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
# multi_accept on;
}
http {
include /etc/nginx/mime.types;
@devyfriend
devyfriend / makeCert.bat
Last active August 23, 2019 11:59
Generate certificate for https on localhost
@echo off
REM IN YOUR SSL FOLDER, SAVE THIS FILE AS: makeCERT.bat
REM AT COMMAND LINE IN YOUR SSL FOLDER, RUN: makecert
REM IT WILL CREATE THESE FILES: example.cnf, example.crt, example.key
REM IMPORT THE .crt FILE INTO CHROME Trusted Root Certification Authorities
REM REMEMBER TO RESTART APACHE OR NGINX AFTER YOU CONFIGURE FOR THESE FILES
REM PLEASE UPDATE THE FOLLOWING VARIABLES FOR YOUR NEEDS.
SET HOSTNAME=localhost
@devyfriend
devyfriend / file_upload_canvas.html
Created August 15, 2018 17:25
select and set uploaded file to canvas
<div class="drag-area">
<div>Tarik dan lepaskan file gambar disini, atau</div>
<div class="custom-file" lang="id">
<input type="file" class="custom-file-input image-file" id="image-file">
<label class="custom-file-label" for="image-file"></label>
</div>
<div class="result-image-block">
<img src="" alt="" class="result-image" width="500" />
</div>
</div>
@devyfriend
devyfriend / init.coffee
Last active July 11, 2018 03:59
atom.io mac setting
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->