Skip to content

Instantly share code, notes, and snippets.

View nyancodeid's full-sized avatar
❤️
Do what you love, love what you do

Ryan Aunur Rassyid nyancodeid

❤️
Do what you love, love what you do
View GitHub Profile
@nyancodeid
nyancodeid / color.js
Last active December 29, 2019 17:17
Lighten and Dark Color Generator
class Color {
constructor (color) {
this.color = color
}
_transform(color, percent) {
var R = parseInt(color.substring(1,3),16);
var G = parseInt(color.substring(3,5),16);
var B = parseInt(color.substring(5,7),16);
@nyancodeid
nyancodeid / commit-message-id.md
Last active November 22, 2025 16:36
Commit Message Guidelines

Pedoman Commit Message

Kami memiliki aturan yang sangat tepat tentang bagaimana pesan git commit kami dapat diformat. Ini mengarah ke pesan yang lebih mudah dibaca yang mudah diikuti ketika melihat melalui history proyek. Dan juga, kami menggunakan pesan git commit untuk menghasilkan log perubahan pada Angular.

Format Commit Message

Setiap pesan komit terdiri dari header, konten, dan catatan kaki. Judul memiliki format khusus yang mencakup jenis, cakupan, dan subjek:

<type>(<scope>): <subject>
<BLANK LINE>
@nyancodeid
nyancodeid / query.json
Created December 31, 2019 05:14
NyanGrab v2.0-alpha
{
"url": "https://www.detik.com/",
"debug": true,
"query": [
{
"name": "articles",
"selector": ".berita-utama article",
"loop": [
{
"name": "title",
@nyancodeid
nyancodeid / console_log.php
Created January 18, 2020 07:19
Logging PHP Variable into console.log javascript
<?php
function console_log($output, $with_script_tags = true) {
$js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) .
');';
if ($with_script_tags) {
$js_code = '<script>' . $js_code . '</script>';
}
echo $js_code;
}
@nyancodeid
nyancodeid / google-img-resize.mdown
Created January 30, 2020 06:00
Google’s authentication-less on-the-fly image resizing service

Google's authentication-less on-the-fly image resizing service

I found it while poking around the Google+ HTML. Jotting down some notes felt like a good idea, so here goes. If you know more about this API, let me know, please!

(Word of warning: I spent ~30 minutes on both my experimentation and this here write-up, so it might not be the most thought-provoking, brilliant thing you read today.)

@nyancodeid
nyancodeid / playlists.js
Created February 24, 2020 11:25
Playlists Aggregation
function getPlaylist(userId, playlistId) {
return database.playlists.aggregate([{
$match: {
_id: ObjectId(playlistId),
user_id: userId
}
}, {
$unwind: {
path: "$audios",
preserveNullAndEmptyArrays: true
@nyancodeid
nyancodeid / omdbapi.js
Created February 26, 2020 03:48
OMDBApi Ajax
function getData () {
$.ajax({
url:'https://www.omdbapi.com',
type:'GET',
dataType:'json',
data:{
'apikey' : 'API_KEY_OMDBAPI', //API Key
'i' : "tt3896196"
},
success: function(data) {
@nyancodeid
nyancodeid / 3.py
Last active March 9, 2020 14:23
python is sucks
import mod_3
jum=int(input("Masukkan jumlah bilangan: "))
datas=[]
for index in range(jum):
datas.append(int(input("Masukkan data: ")))
even, odd = mod_3.search_res(datas)
@nyancodeid
nyancodeid / index.js
Created March 11, 2020 02:17
QR Code API with Cloudflare Worker
import { imageSync } from 'qr-image'
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
/**
* Respond with hello worker text
* @param {Request} request
*/
async function handleRequest(request) {
@nyancodeid
nyancodeid / .env
Created March 29, 2020 12:14
Algolia DocSearch Vuepress
APPLICATION_ID=
API_KEY=