Skip to content

Instantly share code, notes, and snippets.

View defrindr's full-sized avatar
👋
Hi there

Defri Indra Mahardika defrindr

👋
Hi there
View GitHub Profile
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define max 100
struct Stack {
char* origin;
int count;
int top;
<?php
class IG {
public static function get($custom_header = null)
{
$url = "https://www.instagram.com/batutracking19/";
$html_response = file_get_contents($url);
$json_response = explode("window._sharedData = ", $html_response)[1];
$json_response = explode(";</script>", $json_response)[0];
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
using namespace std;
#define IS_NULL(x)(strlen(x) != 0)
#define MAX_DATA_INSERT 2000
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#define LIMIT_NAMA 100
#define LIMIT_ALAMAT 200
#define LIMIT_NO_HP 20
#define LIM_TUJUAN_KUNJUNGAN 200
#define IS_NULL(x)(x != '\0')
array = [1,3,23,46,55,3,67,6,25,9,2,41,6,82,3];
function mengisi_array(arr){
const MAX = 5; // size can used
let par = [null,null,null,null,null], impar = [null,null,null,null,null]; // array penampung
let par_index = 0, impar_index = 0; // index array
let ada_yang_max = false;
for(iter=0;iter<arr.length;iter++){
if(arr[iter] % 2 == 0){
@defrindr
defrindr / bubble_sort.js
Created December 23, 2020 12:27
Materi Sorting Logika Dan Algoritma
array = [30012, 123242,4395,123243935,1232];
// bubble sort
function sort(arr) {
let index_pertukaran = 0, index_komparasi = 0;
for(i = 0; i < arr.length-1; i++) {
let finish_step = false, i=0, j=1, lebih_besar = false;
// step iterasi
while(finish_step == false){
if(arr[i] > arr[j]){
const fetch = require("node-fetch");
const https = require("https");
const fs = require('fs');
const request = require('request');
const readline = require('readline');
const date = new Date();
const apiurl = [
'https://ethol.pens.ac.id/api/v1/tasks?course=',
'&role=2&student=',
// Online C compiler to run C program online
#include <stdio.h>
#include <math.h>
int main() {
int inp = 7;
for(int i=0;i<inp;i++){
for(int j=0;j<inp;j++){
if(i % 2 == 1){
#include <stdio.h>
int main()
{
int n;
printf("Masukkan Inputan ? ");
scanf("%d", &n);
for(int i = 1; i <= n; i++) {
@defrindr
defrindr / readme.md
Last active October 4, 2020 08:58
change php version

Change PHP Version

sudo update-alternatives --config php
sudo a2disconf php[version]-fpm
sudo a2enconf php[version]-fpm
sudo service apache2 restart