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
<?php | |
if(isset($_FILES['image'])) | |
{ | |
$file_name = $_FILES['image']['name']; | |
$file_array = explode(".", $file_name); | |
$file_ext = strtolower(array_pop($file_array)); | |
$file_size = $_FILES['image']['size']; | |
$file_tmp = $_FILES['image']['tmp_name']; | |
$file_type = pathinfo($file_tmp, PATHINFO_EXTENSION); | |
$file_data = file_get_contents($file_tmp); |
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
/* | |
Lépa letek mogyoló, kolán leggel litkán likkant a ligó. | |
A sclipt lecseléli az összes "r" betűt "l" betűle. | |
*/ | |
function ponciusz() { | |
var elements = document.querySelectorAll("body, body *"); | |
var results = []; | |
var child; | |
for(var i = 0; i < elements.length; i++) { |
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
function filter_opacity( &$img, $opacity ) //params: image resource id, opacity in percentage (eg. 80) | |
{ | |
if( !isset( $opacity ) ) | |
{ return false; } | |
$opacity /= 100; | |
//get image width and height | |
$w = imagesx( $img ); | |
$h = imagesy( $img ); |
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 | |
######################### | |
# CPU LIMITER (for OSX) # | |
######################### | |
<<DESCRIPTION | |
The script limits an application CPU usage. | |
------------------------------------------- | |
You have to specify application PID (process id) and desired CPU usage percentage. |
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
function mysqltable_to_htmltable($table) { | |
global $conn; | |
$result0 = mysqli_query($conn,'SHOW COLUMNS FROM '.$table) or die('cannot show columns from '.$table); | |
$result = mysqli_query($conn,'SELECT * FROM '.$table) or die('cannot show columns from '.$table); | |
if(mysqli_num_rows($result0) && mysqli_num_rows($result)) { | |
echo '<table cellpadding="5" cellspacing="0" border="1">'; | |
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 | |
#usage: first parameter is the input image, example: "scipt.sh image.jpg" | |
WIDTH=$(sips $1 -g pixelWidth | tail -1 | grep -oE '[^ ]+$') | |
HEIGHT=$(sips $1 -g pixelHeight | tail -1 | grep -oE '[^ ]+$') | |
NEWWIDTH=$(echo \($WIDTH*1.5\)/1 | bc) | |
NEWHEIGHT=$(echo \($HEIGHT*1.5\)/1 | bc) |
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
<script src="http://maps.google.com/maps/api/js?sensor=false" | |
type="text/javascript"></script> | |
<div id="map" style="width: 500px; height: 400px;"></div> | |
<script type="text/javascript"> | |
var locations = [ | |
['Bondi Beach', -33.890542, 151.274856, 4], | |
['Coogee Beach', -33.923036, 151.259052, 5], | |
['Cronulla Beach', -34.028249, 151.157507, 3], | |
['Manly Beach', -33.80010128657071, 151.28747820854187, 2], |
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
<!doctype html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> | |
<script> | |
$(document).ready(function(){ | |
var getMax = function(){ |
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
<html> | |
<head> | |
<style> | |
#container | |
{ | |
height:2000px; | |
} | |
#container div | |
{ |
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 | |
# | |
# Video recording script for Raspberry Pi. Set bitrate and recording time below | |
# | |
# To autostart this script after login, edit /etc/xdg/lxsession/LXDE-pi/autostart and add the following line BEFORE "@xsreensaver": | |
# | |
# sh ./RaspberryPiVideoRecord.sh | |
# | |
# To convert the output .h264 file to mp4: | |
# |
OlderNewer