Skip to content

Instantly share code, notes, and snippets.

View wackyapps's full-sized avatar
🎯
Focusing

Waqas Mahmood Khan wackyapps

🎯
Focusing
  • Itelc
  • Pakistan
View GitHub Profile
@wackyapps
wackyapps / app.js
Created July 29, 2016 15:06 — forked from ricardoalcocer/app.js
Appcelerator Titanium Android Background Service
// start service
var SECONDS = 20; // every 10 seconds
var intent = Titanium.Android.createServiceIntent({
url: 'logservice.js'
});
intent.putExtra('interval', SECONDS * 1000); // Needs to be milliseconds
Titanium.Android.startService(intent);
@wackyapps
wackyapps / response.php
Created October 14, 2017 13:24 — forked from luckyshot/response.php
Web scraping done right (with cUrl and user agent)
<?php return array (
'url' => 'https://xaviesteve.com/',
'content_type' => 'text/html; charset=UTF-8',
'http_code' => 200,
'header_size' => 578,
'request_size' => 229,
'filetime' => -1,
'ssl_verify_result' => 0,
'redirect_count' => 0,
'total_time' => 0.27407799999999999,
@wackyapps
wackyapps / stream_1
Created April 11, 2019 21:16
single subscription stream example in dart
import 'dart:async';
void main() {
//
// Initialize a "Single-Subscription" Stream controller
//
final StreamController ctrl = StreamController();
//
// Initialize a single listener which simply prints the data
@wackyapps
wackyapps / stream_2.dart
Created April 11, 2019 21:24
Broadcast Stream example in Dart
import 'dart:async';
void main() {
//
// Initialize a "Broadcast" Stream controller of integers
//
final StreamController<int> ctrl = StreamController<int>.broadcast();
//
// Initialize a single listener which filters out the off numbers and
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
import 'package:checksheett/config/AppConstants.dart';
import 'package:flutter/foundation.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
class GraphQLClientConfig {
// JWT Token based GraphQL client
static Future<GraphQLClient> gqlClient(String token) async {
final HttpLink httpLink = HttpLink(AppConstants.GQL_HTTPS_URL);
final AuthLink authLink = AuthLink(
getToken: () async => 'Bearer $token',