Skip to content

Instantly share code, notes, and snippets.

View Abdillah's full-sized avatar
🛰️
Bit Explorer

Faïz Hernawan Abdillah

🛰️
Bit Explorer
View GitHub Profile
@Abdillah
Abdillah / functions.js
Created March 18, 2019 05:50
Nice to have independent functions
function objectToQueryStr(object) {
if (typeof object !== 'object') {
return '';
}
return Object.keys(object).reduce(function (acc, key) {
var item = key + '=' + encodeURI(object[key].toString());
if (acc.length) {
return acc + '&' + item;
@Abdillah
Abdillah / linux-2.6.35.7-to-s5360-r4.diff
Created July 12, 2018 03:21
Different between mainline and S5360 update 4 provided kernel (maybe basically unmodified Android kernel?).
Only in /path/to/linux-2.6.35.7/arch/alpha/kernel: .gitignore
Only in /path/to/linux-2.6.35.7/arch/arm/boot/compressed: .gitignore
diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/boot/compressed/head.S /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/boot/compressed/head.S
--- /path/to/linux-2.6.35.7/arch/arm/boot/compressed/head.S 2010-09-29 08:09:08.000000000 +0700
+++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/boot/compressed/head.S 2018-07-12 10:13:49.000000000 +0700
@@ -21,7 +21,7 @@
#if defined(CONFIG_DEBUG_ICEDCC)
-#ifdef CONFIG_CPU_V6
// https://www.memrise.com/course/199109/250-most-important-adjectives-japanese/
(() => {
function getWords(courseId, level) {
const url = `https://www.memrise.com/ajax/session/?course_id=${courseId}&level_index=${level}&session_slug=preview`
// console.log('Fetching words from ' + url)
return fetch(url, {
credentials: 'same-origin'
@Abdillah
Abdillah / hfsplus-turn-off-journaling.c
Created December 29, 2017 07:00
Turn HFSPlus filesystem journalling feature off
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <byteswap.h>
From a7189b6da6fc320eaf9ccac4511081a5a6977750 Mon Sep 17 00:00:00 2001
From: Hernawan Fa'iz Abdillah <abdillah96.bu@gmail.com>
Date: Sat, 27 Dec 2014 22:43:24 +0700
Subject: [PATCH] Add a capability for ignoring arrow keys. Cause, in some
case, using arrow keys are not considered typing.
---
tools/syndaemon.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
@Abdillah
Abdillah / Makefile
Created December 29, 2017 06:58
Arduino Makefile
# Arduino makefile
# Author: Unknown
#
# This makefile allows you to build sketches from the command line
# without the Arduino environment (or Java).
#
# The Arduino environment does preliminary processing on a sketch before
# compiling it. If you're using this makefile instead, you'll need to do
# a few things differently:
#
@Abdillah
Abdillah / phppear-mail.nix
Created November 15, 2017 02:08
NixOS PHP Pear Mail module install (not tested)
with (<nixpkgs>);
let
mail = { fetchurl }: stdenv.mkDerivation rec {
name = 'phppear-mail-1.3.0';
src = fetchurl {
url = http://download.pear.php.net/package/Mail-1.3.0.tgz;
sha256 = "0n19456jb9bnq0zicwxg9859bhbb5n73mg4m7nijmja8ld7pjlsq";
};
};
@Abdillah
Abdillah / index.html
Created November 14, 2017 11:47
Captcha slider for human
<!DOCTYPE html>
<html>
<head>
<link href="css/slide-to-captcha.css" rel="stylesheet">
<script src="js/modernizr.custom.20910.js"></script>
<script src="js/jquery.js"></script>
<script src="js/slide-to-captcha.js" type="text/javascript"></script>
<script>
var captcha, captcha1, captcha2, captcha3;
@Abdillah
Abdillah / EditableText.js
Created November 14, 2017 11:44
HTML editable text without `<input>`
(function($) {
$.fn.editable = function(options = {}) {
var elements = $(this);
if (options == false) {
var option = {};
option.action = 'inactivate';
}
// TODO: Skip this when not in initialization to enhance speed