Skip to content

Instantly share code, notes, and snippets.

@alyatwa
alyatwa / remove.md
Last active July 10, 2019 01:23
remove add friend button on facebook
package main
import (
"log"
"net/http"
"net/url"
"fmt"
"golang.org/x/net/html"
"io/ioutil"
)
@alyatwa
alyatwa / stepper.h
Created September 15, 2019 21:51
stepper motor
// Arduino stepper motor control code
#include <Stepper.h> // Include the header file
// change this to the number of steps on your motor
#define STEPS 32
// create an instance of the stepper class using the steps and pins
Stepper stepper(STEPS, 8, 10, 9, 11);
@alyatwa
alyatwa / Peltier.ino
Created September 16, 2019 22:32
How to use a Peltier with Arduino
int peltier = 3; //The N-Channel MOSFET is on digital pin 3
int power = 0; //Power level fro 0 to 99%
int peltier_level = map(power, 0, 99, 0, 255); //This is a value from 0 to 255 that actually controls the MOSFET
void setup(){
Serial.begin(9600);
//pinMode(peltier, OUTPUT);
}
@alyatwa
alyatwa / app.js
Created October 7, 2019 14:44 — forked from JuanJo4/app.js
Twitter OAuth with node-oauth for node.js + express 4
/*
Node.js, express, oauth example using Twitters API
Install Dependencies:
npm install express
npm install oauth
Create App File:
Save this file to app.js
@alyatwa
alyatwa / detect_ads_block.js
Created December 29, 2019 20:32
detect uBlock/Adblock and send data to google analytics as event with proxy
document.addEventListener('DOMContentLoaded', init, false);
function init(){
adsBlocked(function(blocked){
if(blocked){
console.log('IsAdsBlocked: true');
jQuery.post( "https://elegant-benz-28d755.netlify.com/proxy/https://www.google-analytics.com/collect",
`v=1&t=event&tid=UA-XXXX-1&cid=555&ec=Ad%20Setting&ea=Adblock&el=Enabled&dt=${jQuery(document).attr('title')}&dp=${jQuery(location).attr('href')}`
).done(function( data ) {
@alyatwa
alyatwa / functions.php
Created January 24, 2020 23:24 — forked from jonathanjanssens/functions.php
Add schema to yoast seo breadcrumbs
<?php
/**
* Add schema to yoast seo breadcrumb
*/
add_filter('wpseo_breadcrumb_links', 'jj_add_crumb_schema', 10, 1);
function jj_add_crumb_schema($crumbs) {
if ( ! is_array( $crumbs ) || $crumbs === array() ) {
@alyatwa
alyatwa / Component.jsx
Created April 5, 2020 16:27 — forked from krambertech/Component.jsx
ReactJS: Input fire onChange when user stopped typing (or pressed Enter key)
import React, { Component } from 'react';
import TextField from 'components/base/TextField';
const WAIT_INTERVAL = 1000;
const ENTER_KEY = 13;
export default class TextSearch extends Component {
constructor(props) {
super();
@alyatwa
alyatwa / install android sdk tool offline.md
Last active February 15, 2022 04:10
install sdk android offline for windows

main tutorial: https://reactnative.dev/docs/environment-setup

Install Android SDK Platform Tools

tutorial: https://androidsdkoffline.blogspot.com/p/android-sdk-platform-tools.html

  1. download platform-29 -->> https://dl.google.com/android/repository/platform-29_r04.zip
  2. using bash cmd >> start with: cd $ANDROID_SDK_ROOT
    rm -rf platforms/android-29 && unzip /f/react/platform-29_r04.zip -d platforms/android-29 && cd platforms/android-29 && mv android-*/* . && rm -rf android-*

Install Android SDK Build Tools

@alyatwa
alyatwa / frida-okhttp3.js
Last active March 16, 2021 01:07 — forked from tiiime/frida-okhttp3.js
frrida log okhttp request
// frida -U ${package} -l request.js
Java.perform(function () {
var OkHttpClient = Java.use("okhttp3.OkHttpClient");
var RealCall = Java.use("okhttp3.RealCall");
OkHttpClient.newCall.implementation = function (request) {
var result = this.newCall(request)
console.log(request.toString())
return result