This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// we determine the key buffer | |
var stringKey = "example"; | |
var cipherText = "........."; | |
// we compute the sha256 of the key | |
var hash = crypto.createHash("sha256"); | |
hash.update(stringKey, "utf8"); | |
var sha256key = hash.digest(); | |
var keyBuffer = new Buffer(sha256key); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Get the instance of TelephonyManager | |
final TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); | |
try { | |
if (tm != null) { | |
Class telephonyManagerClass = Class.forName(tm.getClass().getName()); | |
if (telephonyManagerClass != null) { | |
Method getITelephony = telephonyManagerClass.getDeclaredMethod("getITelephony"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let accessBits = { | |
byte6: { | |
idx: { | |
C23: 0, C22: 1, C21: 2, C20: 3, C13: 4, C12: 5, C11: 6, C10: 7 | |
}, | |
bits: [], | |
}, | |
byte7: { | |
idx: { | |
C13: 0, C12: 1, C11: 2, C10: 3, C33: 4, C32: 5, C31: 6, C30: 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Arithmetic addition function | |
async function add(a, b) { | |
return a + b; | |
} | |
// Usage: | |
add(1, 3).then(result => console.log(result)); | |
// Prints: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description ### Returns Go / Lua like responses(data, err) | |
* when used with await | |
* | |
* - Example response [ data, undefined ] | |
* - Example response [ undefined, Error ] | |
* | |
* | |
* When used with Promise.all([req1, req2, req3]) | |
* - Example response [ [data1, data2, data3], undefined ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y | |
sudo apt-get install libfreetype6 libfreetype6-dev -y | |
sudo apt-get install libfontconfig1 libfontconfig1-dev -y | |
cd ~ | |
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64" | |
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2 | |
sudo tar xvjf $PHANTOM_JS.tar.bz2 | |
sudo mv $PHANTOM_JS /usr/local/share | |
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script is used for create virtual hosts on CentOs. | |
# Created by alexnogard from http://alexnogard.com | |
# Improved by mattmezza from http://you.canmakethat.com | |
# Feel free to modify it | |
# PARAMETERS | |
# | |
# $usr - User | |
# $dir - directory of web files | |
# $servn - webserver address without www. |