Skip to content

Instantly share code, notes, and snippets.

View sontqq's full-sized avatar
🏠
Working from home

Eged Zsolt sontqq

🏠
Working from home
View GitHub Profile
@devidw
devidw / index.php
Created January 30, 2022 03:09
Google 'Untitled'
<?php
error_reporting(0);
if ($_GET["fn"] == "2021st") $_GET["fn"] = "2022st";
if ($_GET["world"] == 15) $_GET["world"] = 5;
if ($_GET["looping"] == 35) $_GET["looping"] = 135;
$apass = "vsio323bacsdi";
@cp6
cp6 / map.php
Created June 23, 2020 01:38
Leaflet map latitude and longitude marker with PHP
<?php
if (isset($_GET['lat']) && isset($_GET['lon'])) {
$lat = $_GET['lat'];
$lon = $_GET['lon'];
} else {
echo "<h1>Latitude and Longitude must be set in URL</h1>";
echo "<p>Example: <a href='map.php?lat=-37.818217&lon=144.956784'>map.php?lat=-37.818217&lon=144.956784</a></p>";
exit;
}
?>
@owldesign
owldesign / mobile_detection.js
Created October 30, 2019 23:27
Mobile Detection in Javascript
// detect if mobile browser. regex -> http://detectmobilebrowsers.com
var isMobile = (function(a){return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|iko
@heaversm
heaversm / openCV-portait-camera-android.java
Last active March 29, 2024 18:30
Renders openCV's camera in portrait mode on android - to be placed in `CameraBridgeViewBase.java`
private final Matrix mMatrix = new Matrix();
private void updateMatrix() {
float mw = this.getWidth();
float mh = this.getHeight();
float hw = this.getWidth() / 2.0f;
float hh = this.getHeight() / 2.0f;
float cw = (float)Resources.getSystem().getDisplayMetrics().widthPixels; //Make sure to import Resources package
@spacehuhn
spacehuhn / esp8266webserver_download_hack.md
Last active October 6, 2024 16:11
ESP8266 Webserver: send or download huge files

The Arduino webserver library from the ESP8266 is very simple and you can get to its limits pretty fast!

So that beeing said I first want to recommend you this library: ESPAsyncWebServer.
It's a very good alternative with a lot of features and it's easy to use.

However I wanna show you an easy way to hack around the standard webserver library for projects which can't make use of the ESPAsyncWebserver library.

So what we want to do is making the ESP8266 serve files via its webserver that are bigger than the RAM size we have left.
A picture for example. You don't want to hold that in the RAM, it's limited and way to valuable to be used for this.

@sungitly
sungitly / BatteryUsage.java
Created March 30, 2016 02:52
Collect Android Battery Usage
private void logBatteryInfoByApi() {
IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
Intent batteryStatus = MainActivity.this.registerReceiver(null, ifilter);
assert batteryStatus != null;
Log.e(LOG_TAG, "STATUS: " + String.valueOf(batteryStatus.getIntExtra(BatteryManager
.EXTRA_STATUS, -1)));
Log.e(LOG_TAG, "PLUG: " + String.valueOf(batteryStatus.getIntExtra(BatteryManager.EXTRA_PLUGGED,
-1)));
Log.e(LOG_TAG, "LEVEL: " + String.valueOf(batteryStatus.getIntExtra(BatteryManager.EXTRA_LEVEL,
@ftvs
ftvs / PhonecallReceiver.java
Last active October 11, 2023 10:05
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: Gabe Sechan http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@khannedy
khannedy / SimpleVersion.java
Last active January 27, 2024 15:01
Get IP Address Android Device
WifiManager wm = (WifiManager) getSystemService(WIFI_SERVICE);
String ip = Formatter.formatIpAddress(wm.getConnectionInfo().getIpAddress());
@seankross
seankross / init.md
Created February 5, 2014 18:26
Initializing GitHub repository

Create a new repository on the command line

touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/seankross/womp.git
git push -u origin master
@rxaviers
rxaviers / gist:7360908
Last active November 18, 2024 03:32
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: