Skip to content

Instantly share code, notes, and snippets.

View Swisyn's full-sized avatar

Dzhunet Hasan Swisyn

  • kleinanzeigen GmbH
  • Berlin, Germany
  • 22:29 (UTC +02:00)
View GitHub Profile
@Swisyn
Swisyn / main.py
Created March 4, 2019 19:29 — forked from mottet-dev/main.py
InstagramBot - Full
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
class InstagramBot():
def __init__(self, email, password):
self.browserProfile = webdriver.ChromeOptions()
self.browserProfile.add_experimental_option('prefs', {'intl.accept_languages': 'en,en_US'})
self.browser = webdriver.Chrome('chromedriver.exe', chrome_options=self.browserProfile)
self.email = email
package com.abizareyhan;
import android.content.Context;
import android.graphics.drawable.GradientDrawable;
import android.support.v7.widget.AppCompatButton;
import android.util.AttributeSet;
import com.abizareyhan.reyplayground.R;
public class CustomizableButton extends AppCompatButton {
@Swisyn
Swisyn / GoogleTranslate.workflow
Created December 6, 2018 14:13 — forked from buddax2/GoogleTranslate.workflow
Google Translate Automator Service
on run {input, parameters}
set output to "http://translate.google.com/translate_t?sl=auto&tl=uk&text=" & urldecode(input as string)
return output
end run
on urldecode(x)
set cmd to "'require \"cgi\"; puts CGI.escape(STDIN.read.chomp)'"
do shell script "echo " & quoted form of x & " | ruby -e " & cmd
end urldecode
func webView(webView: WKWebView, decidePolicyForNavigationAction navigationAction: WKNavigationAction, decisionHandler: (WKNavigationActionPolicy) -> Void) {
let url = navigationAction.request.URL?.absoluteString
let hostAddress = navigationAction.request.URL?.host
// To connnect app store
if hostAddress == "itunes.apple.com" {
if UIApplication.sharedApplication().canOpenURL(navigationAction.request.URL!) {
@Swisyn
Swisyn / SimpleClient.swift
Created June 30, 2018 17:14 — forked from sarpsolakoglu/SimpleClient.swift
Simple Swift 4 Rest Client that uses the Codable protocol for JSON conversion
//
// SimpleClient.swift
//
// Created by Sarp Solakoglu on 18/09/2017.
// Copyright © 2017 Sarp Solakoglu. All rights reserved.
//
import Foundation
enum RestMethod: String {
@Swisyn
Swisyn / GagSsl.java
Created May 10, 2018 21:17 — forked from mefarazath/GagSsl.java
Get OkHttpClient which ignores all SSL errors.
private static OkHttpClient getUnsafeOkHttpClient() {
try {
// Create a trust manager that does not validate certificate chains
final TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain,
String authType) throws CertificateException {
}
@Swisyn
Swisyn / Connectivity.java
Created April 28, 2018 19:42 — forked from emil2k/Connectivity.java
Android utility class for checking device's network connectivity and speed.
/*
* Copyright (c) 2017 Emil Davtyan
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@Swisyn
Swisyn / Locator.java
Created April 28, 2018 19:42 — forked from emil2k/Locator.java
Android utility class for getting device location using various methods. Depends on `Connectivity` class found here: https://gist.github.com/emil2k/5130324
/*
* Copyright (c) 2017 Emil Davtyan
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@Swisyn
Swisyn / README.md
Created February 26, 2018 07:29 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@Swisyn
Swisyn / build.gradle
Created February 8, 2018 05:43 — forked from dzungpv/build.gradle
Gradle obfuscate string
apply from: "$rootDir/utils.gradle"
android {
defaultConfig {
buildConfigField 'String', 'SECRET_KEY', toJavaCodeString(SECRET_KEY)
}
}