Skip to content

Instantly share code, notes, and snippets.

View arma7x's full-sized avatar
🎯
Focusing

Ahmad Malik arma7x

🎯
Focusing
  • PayPal ahmadmuhamad101@gmail.com
  • MY
View GitHub Profile
{
"name": "Audio",
"description": "An audio player for KaiOS",
"launch_path": "/index.html",
"theme": "#873eff",
"theme_color": "#873eff",
"background_color": "#873eff",
"icons": {
"16": "/icons/icon16x16.png",
"48": "/icons/icon48x48.png",
function handleKeydown(e) {
switch(e.key) {
case '*':
toggleShuffle();
break
case '0':
if (!PLAYER.src) {
break
}
togglePlay();
window.addEventListener("load", function() {
navigator.mozBluetooth.onattributechanged = function() {
console.log('onattributechanged');
navigator.mozBluetooth.defaultAdapter.stopDiscovery()
.then(function() {
return navigator.mozBluetooth.defaultAdapter.startDiscovery();
})
.then(function(handler) {
handler.ondevicefound = function(event) {
@arma7x
arma7x / ng_utils.js
Created July 18, 2020 10:52
ng_utils.js
/*!
* Webogram v0.7.0 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE
*/
angular.module('izhukov.utils', [])
.provider('Storage', function () {
@arma7x
arma7x / main.dart
Created May 3, 2019 22:20 — forked from branflake2267/main.dart
Flutter - Navigation Drawer Left or Right
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
@arma7x
arma7x / MY_Controller.php
Created April 16, 2019 05:00
How to use silexphp/Pimple in Codeigniter 3
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
use Pimple\Container;
class MY_Controller extends CI_Controller {
public $container; // declare new variable to assign Container instance
public function __construct() {
@arma7x
arma7x / Golang PosLaju Scrapper
Last active April 11, 2019 04:26
Golang script to track Poslaju shipping progress in terminal
package main
import (
"fmt"
"github.com/PuerkitoBio/goquery"
"gopkg.in/headzoo/surf.v1"
"log"
"os"
"regexp"
"strings"
@arma7x
arma7x / goQueryTest.go
Created April 10, 2019 17:20 — forked from salmoni/goQueryTest.go
Parsing HTML in Go/Golang using goQuery to extract data from only one of multiple tables. Demonstrates nested Find statements.
package main
import (
"fmt"
"log"
"strings"
"github.com/PuerkitoBio/goquery"
)
@arma7x
arma7x / polyline_decoder.js
Created February 22, 2018 14:24 — forked from ismaels/polyline_decoder.js
Javascript function to decode google maps api polyline
// source: http://doublespringlabs.blogspot.com.br/2012/11/decoding-polylines-from-google-maps.html
function decode(encoded){
// array that holds the points
var points=[ ]
var index = 0, len = encoded.length;
var lat = 0, lng = 0;
while (index < len) {
var b, shift = 0, result = 0;
@arma7x
arma7x / index.php
Created August 12, 2016 21:27 — forked from geggleto/index.php
Slim 3 Middleware - Force HTTPS
$app->add(function (Request $request, Response $response, $next) {
if ($request->getUri()->getScheme() !== 'https') {
$uri = $request->getUri()->withScheme("https")->withPort(null);
return $response->withRedirect( (string)$uri );
} else {
return $next($request, $response);
}
});