Skip to content

Instantly share code, notes, and snippets.

View acfatah's full-sized avatar
🏠
Working from home

Achmad F. Ibrahim acfatah

🏠
Working from home
  • Temerloh, Pahang, Malaysia
  • 06:22 (UTC +08:00)
  • X @acfatah
View GitHub Profile

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this->anything()
@acfatah
acfatah / github markdown syntax.md
Last active September 23, 2020 00:35 — forked from MinhasKamal/github markdown syntax.md
Markdown Syntax for GitHub.
@acfatah
acfatah / vim-shortcuts.md
Created June 17, 2021 09:16 — forked from tuxfight3r/vim-shortcuts.md
VIM SHORTCUTS

VIM KEYBOARD SHORTCUTS

MOVEMENT

h        -   Move left
j        -   Move down
k        -   Move up
l        -   Move right
$        -   Move to end of line
0        -   Move to beginning of line (including whitespace)
@acfatah
acfatah / node-sample.js
Created May 13, 2022 00:36 — forked from gus3inov/node-sample.js
get battery info with node.js
const http = require('http');
const PORT = Number(process.argv[2]) || 8080;
const child_process = require('child_process');
const Routes = {
BATTERY: /\/battery\/?/
};
const Status = {
NOT_FOUND: 404,
The MIT License (MIT)
Copyright (c) 2013 Jamar Parris
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S
@acfatah
acfatah / authenticable.rb
Created December 7, 2022 08:52 — forked from esteedqueen/authenticable.rb
JSON API User Registration and Sessions with Devise
module Authenticable
# Devise methods overwrite
def current_user
@current_user ||= User.find_by(authentication_token: request.headers['Authorization'])
end
def authenticate_with_token!
render json: { errors: "Not authenticated" },
status: :unauthorized unless user_signed_in?
@acfatah
acfatah / singleton_logger.rb
Created December 19, 2022 03:21 — forked from cheeyeo/singleton_logger.rb
Simple logger using Ruby's built in Singleton module
require 'singleton'
class SimpleLogger
include Singleton
attr_accessor :level
ERROR=1
WARNING=2
INFO=3
@acfatah
acfatah / unix-digitalocean-spaces-s3cmd.md
Last active January 27, 2023 03:39 — forked from jbutko/unix-digitalocean-spaces-s3cmd.md
Unix (ubuntu): setup and use s3cmd to upload files to digitalocean spaces
@acfatah
acfatah / bash_template.sh
Created February 2, 2023 02:46 — forked from rsperl/bash_template.sh
bash script templates #shell #template #snippet
#!/bin/bash
# see also
# - Google's Shell Style Guide: https://google.github.io/styleguide/shell.xml
# - ShellCheck: https://github.com/koalaman/shellcheck
# src:
# - http://hackaday.com/2017/07/21/linux-fu-better-bash-scripting
# - https://dev.to/thiht/shell-scripts-matter
@acfatah
acfatah / component-app.js
Created February 7, 2023 08:16 — forked from kesor/component-app.js
Vue.js 3.x with ES6 modules in the browser using import-map
import { defineAsyncComponent } from 'vue'
const Content = defineAsyncComponent(() => import('./component-content.js'))
export default {
name: 'App',
components: { Content },
template: /*html*/`
<Content />
`