Skip to content

Instantly share code, notes, and snippets.

@pipiscrew
pipiscrew / google-translate.html
Created May 27, 2018 19:02
plain google translate for plain or wordpress use
<!--
for wordpress edit the single.php and the following code
Added the 20 famous languages as described at :
http://mentalfloss.com/article/67766/worlds-top-20-languages-and-words-english-has-borrowed-them -->
<select id="tcombo" style='float:right;font-size:small;' onchange='if (document.getElementById("tcombo").value == 0) return; window.open("https://translate.google.com/translate?sl=auto&tl=" + document.getElementById("tcombo").value + "&u=" + location.href)'>
<option value=0>-translate-</option>
<option value="ar">Arabic</option>
<option value="bn">Bengali</option>
@pipiscrew
pipiscrew / recaptcha.html
Created October 18, 2017 17:36
Recaptcha Landing Page Demo - Avoid Bots
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0;">
<title>Recaptcha Landing Page Demo - Avoid Bots</title>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script>
var validate = function(gResponse){
jQuery.ajax({
url: '/recaptcha/',
@pipiscrew
pipiscrew / index.php
Last active March 11, 2017 19:09
WordPress - Insert Post to wordpress from your PHP custom application. Login form supported
<?php
@session_start();
require_once('../wp-load.php');
//when form submited
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
@pipiscrew
pipiscrew / General.cs
Last active October 14, 2016 17:57
C# dbase connections
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Windows.Forms;
namespace PipisCrew.Helpers
{
@pipiscrew
pipiscrew / permissions.txt
Created October 5, 2016 19:14 — forked from Arinerron/permissions.txt
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO
@pipiscrew
pipiscrew / config.php
Last active March 5, 2017 15:12
Login Form with Login Atempts and 1day expiration cookie
<?php
/**
* @link https://pipiscrew.com
* @copyright Copyright (c) 2016 PipisCrew
*/
function connect_mysql() {
$mysql_hostname = "localhost";
$mysql_user = "";
@pipiscrew
pipiscrew / webssql.htm
Created May 10, 2016 19:54 — forked from andyj/webssql.htm
Look at the basics of WebSQL
<html>
<head>
<title>Look at WebSQL</title>
<script>
// Through the code below remember essentialy there are just 3 core methods we tend to use
// openDatabase
// transaction
// executeSql
// Opening a connection
@pipiscrew
pipiscrew / json_decode_by_PHP_array.java
Created April 12, 2016 18:54
json decode by PHP array
////////////////// PHP
//get_multi_recordset.php
$brands = getSet($db, "select brand_id from brands where user_id=?", array($user_id));
$categories = getSet($db, "select category_id from categories where user_id=?", array($user_id));
$subcategories = getSet($db, "select subcategory_id from subcategories where user_id=?", array($user_id));
$payments = getSet($db, "select payment_id from payments where user_id=?", array($user_id));
$json = array('brands'=> $brands, 'categories' => $categories, 'subcategories' => $subcategories, 'payments' => $payments);
header("Content-Type: application/json", true);
@pipiscrew
pipiscrew / login.java
Last active March 5, 2016 11:13
[android] Login Pattern with MySQL + APK Sign Verification
//control the application from server, new version is out? update the mysql_table, oldversion users cant sign in!
//your APK cracked? users cant login without a valid APK sign
String sign = "";
String version = "";
PackageInfo info;
try {
info = getPackageManager().getPackageInfo(getPackageName(), PackageManager.GET_SIGNATURES);
version = String.valueOf(info.versionCode); //ref : line 70
@pipiscrew
pipiscrew / call method exists in fragment from actionbar settings.java
Last active April 12, 2016 18:51
[Actiobar] settings menu - call method in fragment
//source - http://stackoverflow.com/a/22182746/1320686
//the activity_main.xml
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Framelayout to display Fragments -->
<FrameLayout