This project has moved to https://github.com/lovasoa/dezoom.sh
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 fitStringToSize(str,len) { | |
var result = str; | |
var span = document.createElement("span"); | |
span.style.visibility = 'hidden'; | |
span.style.padding = '0px'; | |
document.body.appendChild(span); | |
// on first run, check if string fits into the length already. | |
span.innerHTML = result; | |
if(span.offsetWidth > len) { |
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
// This bit is important. It detects/adds XMLHttpRequest.sendAsBinary. Without this | |
// you cannot send image data as part of a multipart/form-data encoded request from | |
// Javascript. This implementation depends on Uint8Array, so if the browser doesn't | |
// support either XMLHttpRequest.sendAsBinary or Uint8Array, then you will need to | |
// find yet another way to implement this. (This is left as an exercise for the reader, | |
// but if you do it, please let me know and I'll integrate it.) | |
// from: http://stackoverflow.com/a/5303242/945521 | |
if ( XMLHttpRequest.prototype.sendAsBinary === undefined ) { |
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
# Apache Server Config | MIT License | |
# https://gist.github.com/bhubbard/6082577 | |
# Modified from https://github.com/h5bp/server-configs-apaches | |
# ############################################################################## | |
# # Default WordPress # | |
# ############################################################################## | |
# http://randomtype.ca/blog/the-wordpress-htaccess-file-explained/ | |
# BEGIN WordPress |
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
package com.codeoverdrive.util; | |
import android.graphics.Typeface; | |
import android.text.SpannableString; | |
import android.text.SpannableStringBuilder; | |
import android.text.TextPaint; | |
import android.text.style.StyleSpan; | |
import java.util.ArrayList; | |
import java.util.List; |
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 | |
$db = @mysql_connect('localhost', 'root', 'password') or die(mysql_error()); | |
mysql_select_db('test', $db) or die(mysql_error()); | |
$qry_qbank = mysql_query("SELECT * FROM at_qa_dump limit 100") or die(mysql_error()); | |
//require('wp-blog-header.php'); | |
while ($row = mysql_fetch_array($qry_qbank)) { | |
$qno = $row['ID']; | |
$question_title = $row['Question_Title']; | |
$question_content = $row['Question_Content']; |
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
#https://www.google.com/search?q=smbios.reflecthost&oq=smbios.r&aqs=chrome.0.0j69i57j0l4.2850j0j7&sourceid=chrome&ie=UTF-8 | smbios.reflecthost - Google Search | |
#http://www.bitcon.be/how-to-install-an-hp-branded-windows-os-as-a-virtual-server/ | How to install an HP branded Windows OS as a virtual server | BITCON - IT consultants | |
#https://communities.vmware.com/thread/162241?tstart=0 | This system is not supported platform |VMware Communities | |
#https://superuser.com/questions/199906/how-to-edit-bios-information-for-a-virtual-machine-in-vmware | How to edit BIOS information for a virtual machine in VMWare? - Super User | |
#http://www.insanelymac.com/forum/topic/292170-how-to-spoof-real-mac-in-vmware/ | How to spoof real Mac in VMware - Multi-booting and Virtualisation - InsanelyMac Forum | |
Method 1: edit VMX file for the specific VM | |
#add this line | |
SMBIOS.reflectHost = TRUE |
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 | |
/** | |
* Check the orderby param for the particular REST API for hte custom post type. | |
* If it is set to a particular meta_ket, then set the orderby and meta_key query args/ | |
* @link https://www.timrosswebdevelopment.com/wordpress-rest-api-order-by-meta_value/ | |
*/ | |
function filter_rest_accommodation_query($query_vars, $request) { | |
$orderby = $request->get_param('orderby'); | |
if (isset($orderby) && $orderby === 'number_of_beds') { | |
$query_vars["orderby"] = "meta_value_num"; |
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 | |
// Register the meta field for the rest api | |
// https://stackoverflow.com/questions/56460557/how-to-include-meta-fields-in-wordpress-api-post#answer-56508996 | |
add_action( 'rest_api_init', 'register_postviews_meta_fields'); | |
function register_postviews_meta_fields(){ | |
register_meta( 'post', 'wpb_post_views_count', array( | |
'type' => 'integer', | |
'description' => 'Post views', | |
'single' => true, |
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
import xml.etree.ElementTree as ET | |
import glob | |
import os | |
import json | |
def xml_to_yolo_bbox(bbox, w, h): | |
# xmin, ymin, xmax, ymax | |
x_center = ((bbox[2] + bbox[0]) / 2) / w | |
y_center = ((bbox[3] + bbox[1]) / 2) / h |
OlderNewer