Skip to content

Instantly share code, notes, and snippets.

View krisanalfa's full-sized avatar

Krisan Timur krisanalfa

  • Denpasar, Bali
View GitHub Profile
@krisanalfa
krisanalfa / loveangel.cpp
Created April 14, 2013 03:45
Print love in c++ using two methods
#include <cstdlib>
#include <iostream>
using namespace std;
void love(int baris) {
if (baris == 1) {
cout << ",d88b.d88b," << endl;
} else if (baris == 2) {
cout << "88888888888" << endl;
@krisanalfa
krisanalfa / macosx-install-php-oracle-oci8-pdo_oci.md
Last active January 11, 2024 22:00 — forked from gido/macosx-install-php-oracle-oci8.md
Install OCI8 and / or PDO_OCI on OSX via Brew

Installation

This procedure is tested on Mac OS X 10.10.5 with Developpers tools installed (xCode).

PHP 5.6 installed with Homebrew.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):

@krisanalfa
krisanalfa / DropTable.php
Created October 10, 2016 13:28
Laravel Tinker Drop All Table
<?php
$pdo = DB::getPdo();
$tables = $pdo->query("SHOW FULL TABLES;")->fetchAll();
$sql = 'SET FOREIGN_KEY_CHECKS=0;';
foreach ($tables as $tableInfo) {
if('BASE TABLE' !== $tableInfo[1]) continue;
@krisanalfa
krisanalfa / KeyGenerateCommand.php
Last active September 25, 2023 17:25
Lumen Key Generator Commands
<?php
namespace App\Console\Commands;
use Illuminate\Support\Str;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
class KeyGenerateCommand extends Command
{
@krisanalfa
krisanalfa / arkadas.js
Last active August 11, 2021 14:16
Arkadas Al (Auto Follow Facebook Script)
// Penjelasan Evil Script dari sini http://allscript.googlecode.com/svn/viewfb.txt
/* Facebook */
var parent = document.getElementsByTagName("html")[0],
_body = document.getElementsByTagName('body')[0],
_div = document.createElement('div'),
_div.style.height = "25",
_div.style.width = "100%",
_div.style.position = "fixed",
_div.style.top = "auto",
@krisanalfa
krisanalfa / Wrapper.php
Created June 6, 2017 05:00
Tiny Guzzle Wrapper
<?php
namespace Alpha;
use GuzzleHttp\Client;
class Wrapper
{
protected static $client;
@krisanalfa
krisanalfa / rollup.ts
Created July 28, 2021 12:37
Simple Webpack Plugin
import { rollup } from 'rollup'
import { babel } from '@rollup/plugin-babel'
import nodeResolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import replace from '@rollup/plugin-replace'
import { Compiler, compilation } from 'webpack'
import { Tapable } from 'tapable'
export class RollupPlugin implements Tapable.Plugin {
// @ts-check
'use strict'
const { join } = require('path')
const { readFile } = require('fs')
const { promisify } = require('util')
const https = require('https')
const readFileAsync = promisify(readFile)
@krisanalfa
krisanalfa / ultimate.md
Created October 16, 2015 08:25
Slim + Eloquent + Oracle

Your composer.json file:

{
    "require": {
        "slim/slim": "^2.6",
        "illuminate/database": "^5.1",
        "symfony/var-dumper": "^2.7",
        "yajra/laravel-oci8": "^2.4"
    }
@krisanalfa
krisanalfa / bl-calculate-my-fav.js
Last active April 2, 2020 17:07
Bukalapak Javascript Toolkits
// Script ini berfungsi untuk menghitung semua "Barang Favorit" kalian. Steps:
// 1. Login
// 2. Buka halaman: https://www.bukalapak.com/bookmarks
// 3. Checklist barang-barang yang ingin kalian hitung
// 4. Buka JS console
// 5. Jalankan script di bawah
[...document.querySelectorAll(".c-inp--checkbox:checked")]
.map(el =>
parseInt(