Skip to content

Instantly share code, notes, and snippets.

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

Halid Juki burnz

🏠
Working from home
View GitHub Profile
{
"env": {
"es6": true
},
"ecmaFeatures": {
// env=es6 doesn't include modules, which we are using
"modules": true
},
@burnz
burnz / gist:bcea55161399cd110510
Created October 14, 2015 22:05
PHP Function startWith & endWith
<?php
function startsWith($haystack, $needle) {
// search backwards starting from haystack length characters from the end
return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;
}
function endsWith($haystack, $needle) {
// search forward starting from end minus needle length characters
return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);
}
@burnz
burnz / Install ARM Translation and Gapps from inside Genymotions
Last active December 22, 2021 12:19
Install ARM Translation and Gapps from inside Genymotions
1. Install Terminal Emulator1. This is needed so you can do shell commands. Obtain the APK then drag & drop the file to your device's window. The shell should popup, and the icon should now be in your app drawer.
2. Install the ARM translator. Extract the Genymotion-ARM-Translation_v1.1.zip file. Inside it is a directory called /system. Drag this directory to your virtual device's window. It should say "File succesfully copied to /sdcard/Download".
Then, run Terminal Emulator. Get root by running the command: su
Allow SuperUser to give Terminal Emulator root. Now run the following commands:
mount -o remount,rw /system
cp -Rf /sdcard/Download/system/* /system
chmod -R 0755 /system
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (https://www.androidfilehost.com/?fid=22979706399755082 - gapps-jb-20121011-signed.zip)
@burnz
burnz / remote-typeahead.js
Created June 15, 2012 11:13 — forked from geuis/remote-typeahead.js
Remote data querying for Twitter Bootstrap 2.0 Typeahead without modifications
<script>
// Charles Lawrence - Feb 16, 2012. Free to use and modify. Please attribute back to @geuis if you find this useful
// Twitter Bootstrap Typeahead doesn't support remote data querying. This is an expected feature in the future. In the meantime, others have submitted patches to the core bootstrap component that allow it.
// The following will allow remote autocompletes *without* modifying any officially released core code.
// If others find ways to improve this, please share.
var autocomplete = $('#searchinput').typeahead({
items: 10
})
.on('keyup', function(ev){