Skip to content

Instantly share code, notes, and snippets.

View chrisk8er's full-sized avatar
💭
I may be slow to respond.

Krestian Weken chrisk8er

💭
I may be slow to respond.
View GitHub Profile
@chrisk8er
chrisk8er / example-typeorm-jest.test.ts
Created December 14, 2022 07:42 — forked from Ciantic/example-typeorm-jest.test.ts
Example of testing TypeOrm with Jest and Sqlite in-memory database
import { createConnection, getConnection, Entity, getRepository } from "typeorm";
import { PrimaryGeneratedColumn, Column } from "typeorm";
@Entity()
export class MyEntity {
@PrimaryGeneratedColumn()
id?: number;
@Column()
name?: string;
@chrisk8er
chrisk8er / apache-proxy-permission-denied.md
Created December 8, 2022 04:28
Apache proxy error Permission denied

When you're setup a proxy reverse on virtual host. sometimes you will counter with apache http proxy error.

<VirtualHost *:80>
    ServerName domain.com
    ServerAlias www.domain.com
    ProxyPreserveHost On

    ProxyPass / http://localhost:8001/
    ProxyPassReverse / http://localhost:8001/
    
@chrisk8er
chrisk8er / LocationManagerImpl.kt
Created September 23, 2022 08:33 — forked from Razeeman/LocationManagerImpl.kt
Android Get User Location Manager
class LocationManagerImpl @Inject constructor(
private val permissionManager: PermissionManager,
private val context: Context
) : LocationManager {
override fun getUserLocationUpdates(): Observable<UserLocation> =
if (checkIfGooglePlayAvailable()) getLocationFromGooglePlay() else getLocationFromAndroidSdk()
override fun getDefaultLocation(): UserLocation = UserLocation(DEFAULT_LATITUDE, DEFAULT_LONGITUDE)

Connecting State

Opening Whatsapp page

Incoming webhook: {"erro":false,"text":"Starting browser...","status":"initBrowser","statusFind":"browser","onType":"connection","session":"user","token":""}
Incoming webhook: {"erro":false,"text":"Opening whatsapp page!","status":"initWhatsapp","statusFind":"browser","onType":"connection","session":"user","token":""}
Incoming webhook: {"erro":false,"text":"Website accessed successfully","status":"openedWhatsapp","statusFind":"browser","onType":"connection","session":"user","token":""}
@chrisk8er
chrisk8er / ml5.d.ts
Created June 25, 2022 04:27 — forked from dikarel/ml5.d.ts
ml5.js TypeScript definitions draft
// Not quite there yet, but better than nothing
// TODO: JSDoc, based on website documentation
// TODO: Interface/class types for each of these ML algorithm instances
// TODO: Break this apart into multiple files for readability
// TODO: Test autocomplete in a vanilla JS project
// TODO: Test autocomplete in a TypeScript project
import { MediaElement } from "p5";
export as namespace ml5;
@chrisk8er
chrisk8er / gist:04f0d6d85ac8a06a3bd7f67cba87692e
Created February 22, 2022 01:44 — forked from 480/gist:3b41f449686a089f34edb45d00672f28
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings

MacOS X + oh my zsh + powerline fonts + visual studio code (vscode) terminal settings

Thank you everybody, Your comments makes it better

Install oh my zsh

http://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@chrisk8er
chrisk8er / simple-pagination.js
Created June 23, 2021 04:45 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@chrisk8er
chrisk8er / proxy_for_terminal.md
Created June 22, 2021 03:57 — forked from fearblackcat/proxy_for_terminal.md
Set proxy for terminal on mac

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@chrisk8er
chrisk8er / .htaccess
Last active August 19, 2020 04:38 — forked from alexsasharegan/.htaccess
Apache Config for React Router
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
@chrisk8er
chrisk8er / .block
Created March 19, 2020 03:03 — forked from tvalentius/.block
Provinces in Indonesia
border: no
license: MIT