Skip to content

Instantly share code, notes, and snippets.

View oximenvn's full-sized avatar

oximenvn oximenvn

View GitHub Profile
@oximenvn
oximenvn / disable.sh
Last active February 25, 2022 09:11
Script disable bloatware, ads of Fire HD 10 2019
#Must to install new laucher before runing script
while read p; do
echo "adb shell pm disable-user $p"
adb shell pm disable-user "$p" 0>/dev/null
#adb shell pm enable "$p" 0>/dev/null
done <ok-1430.txt
# Turn off update for amazon app dont return
adb shell pm disable-user com.amazon.settings.systemupdates
@oximenvn
oximenvn / Mongo-Nodejs.js
Last active October 4, 2019 01:00
Mongo-Nodejs driver demo
const MongoClient = require('mongodb').MongoClient;
const assert = require('assert');
// Connection URL
const url = 'mongodb://thanh:123456@localhost:27017/mydb';
// Database Name
const dbName = 'mydb';
// Use connect method to connect to the server
@oximenvn
oximenvn / APISync.apxc.java
Created August 20, 2019 09:20
Syncing for Outbound transfer to Salesforce
@RestResource(urlMapping='/Teams/*')
global with sharing class MyRestResource {
@HttpPut
global static String putCustomer(){
RestRequest req = Restcontext.request;
List<SObject> sbjectList = new List<SObject>();
// Deserialize
Map<String, Object> params = (Map<String, Object>)JSON.deserializeUntyped(req.requestBody.tostring());
System.debug(params);
@oximenvn
oximenvn / PyForce.py
Created August 19, 2019 08:44
demo access salesforce rest api
import requests
import json
class PyForce:
def __init__(self, client_id, client_secret, username, password, security_token):
self.client_id = client_id
self.client_secret = client_secret
self.username = username
self.password = password
self.security_token = security_token
@oximenvn
oximenvn / MyRestResource.apxc.java
Last active August 19, 2019 07:49
custom apex rest api
@RestResource(urlMapping='/Teams/*')
global with sharing class MyRestResource {
@HttpGet
global static List<Team__c> getTeamById() {
RestRequest request = RestContext.request;
RestResponse res = RestContext.response;
// grab the caseId from the end of the URL
String teamId = request.requestURI.substring(
request.requestURI.lastIndexOf('/')+1);
package main
import (
"fmt"
"math"
"math/rand"
"time"
)
/*
* Point
package main
import (
"fmt"
"os"
"image"
"image/jpeg"
"image/color"
"image/png"
)
package main
import ("fmt"
//"bufio"
//"os"
)
func main() {
var n,p,q,r int