Skip to content

Instantly share code, notes, and snippets.

View ariezncahyo's full-sized avatar
:octocat:

ariezncahyo

:octocat:
View GitHub Profile
let argv = process.argv // ambil param input
let kata = (argv.splice(2) || [""]) // ambil array ke 2 dst
.toString() // ubah ke dalam string
.replace(/,/g,"") // hilangkan semua koma
.toLowerCase() // ubah ke huruf kecil
.split("") // ubah ke dalam array
//let kata2 = ["Test Case"]
// .toString() // ubah ke dalam string
@ariezncahyo
ariezncahyo / ffmpeg.md
Created November 26, 2017 14:57 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@ariezncahyo
ariezncahyo / jaccard-similarity-python.py
Created November 2, 2016 14:25 — forked from Renien/jaccard-similarity-python.py
Jaccard Similarity: The Jaccard similarity of sets is the ratio of the size of the intersection of the sets to the size of the union. This measure of similarity is suitable for many applications, including textual similarity of documents and similarity of buying habits of customers.
__author__ = 'renienj'
import numpy as np
def compute_jaccard_similarity_score(x, y):
"""
Jaccard Similarity J (A,B) = | Intersection (A,B) | /
| Union (A,B) |
"""
intersection_cardinality = len(set(x).intersection(set(y)))
@ariezncahyo
ariezncahyo / gist:3105fcace1d2dbfd4af55ce9c34b079f
Created November 2, 2016 14:11
Return the coefficient of two items based on Jaccard index
<?php
/**
* Return the coefficient of two items based on Jaccard index
* http://en.wikipedia.org/wiki/Jaccard_index
*
* Example:
*
* $tags1 = "code, php, jaccard, test, items";
* $tags2 = "test, code";
@ariezncahyo
ariezncahyo / code.snippet.textprint.pas
Created March 2, 2016 07:52 — forked from rehmoe/code.snippet.textprint.pas
Kode prosedur direct printing (textbased)
procedure TextPrint(lst:TStringList);
var
F: TextFile;
begin
AssignFile(F,'LPT1');
Rewrite(F);
Write(F,lst.Gettext);
CloseFile(F);
end;