⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
© 2012 - <?php echo date("Y"); ?> dasoft.ch |
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 getQueryVariable(variable) { | |
var query = window.location.search.substring(1); | |
var vars = query.split("&"); | |
for (var i=0;i<vars.length;i++) { | |
var pair = vars[i].split("="); | |
if(pair[0] == variable){ | |
return pair[1]; | |
} | |
} | |
return(false); |
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
public class WebScanner { | |
// These are the variables that hold the URL and the | |
// image when done loading | |
private BufferedImage img; | |
private URL url; | |
// This is a bit more complicated, but I explained it above. | |
private SwingWorker<BufferedImage, Void> worker = new SwingWorker<BufferedImage, Void>() { | |
@Override |
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 | |
$page_id = "YOUR PAGE-ID"; | |
$xml = @simplexml_load_file("http://api.facebook.com/restserver.php?method=facebook.fql.query&query=SELECT%20fan_count%20FROM%20page%20WHERE%20page_id=".$page_id."") or die ("a lot"); | |
$fans = $xml->page->fan_count; | |
echo $fans; | |
?> | |
//MAKE FIRST WORD BOLD |
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> | |
<title>Leaflet</title> | |
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" /> | |
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script> | |
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script> | |
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script> | |
</head> | |
<body> |
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
public static void mergeExcelFiles(File file, List<FileInputStream> list) throws IOException { | |
HSSFWorkbook book = new HSSFWorkbook(); | |
HSSFSheet sheet = book.createSheet(file.getName()); | |
for (FileInputStream fin : list) { | |
HSSFWorkbook b = new HSSFWorkbook(fin); | |
for (int i = 0; i < b.getNumberOfSheets(); i++) { | |
copySheets(book, sheet, b.getSheetAt(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
SELECT CONCAT(table_schema, '.', table_name), | |
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, | |
CONCAT(ROUND(data_length / ( 1024 * 1024 ), 2), 'MB') DATA, | |
CONCAT(ROUND(index_length / ( 1024 * 1024 ), 2), 'MB') idx, | |
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 ), 2), 'MB') total_size, | |
ROUND(index_length / data_length, 2) idxfrac | |
FROM information_schema.TABLES | |
-- WHERE table_schema = 'YOUR DATABASE NAME' |
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
SELECT | |
t.cid AS mid, | |
t.email_ AS email, | |
t.group_id_ AS group_id, | |
GROUP_CONCAT(t.fname_ SEPARATOR '') AS fname, | |
GROUP_CONCAT(t.lname_ SEPARATOR '') AS lname, | |
t.street_ AS street, | |
GROUP_CONCAT(t.city_ SEPARATOR '') AS city, | |
GROUP_CONCAT(t.state_code_ SEPARATOR '') AS state_code, | |
GROUP_CONCAT(t.zip_ SEPARATOR '') AS zip, |
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
SELECT customer_id, order_cnt, totalBestellwertUser | |
FROM ( | |
SELECT customer_id, | |
COUNT(customer_id) AS order_cnt, | |
SUM(totalBestellwert) AS totalBestellwertUser | |
FROM (SELECT so.customer_id, | |
YEAR(so.created_at) AS year_ordered, | |
SUM(base_grand_total) AS totalBestellwert, | |
group_concat(si.sku SEPARATOR ',') AS skus | |
FROM `sales_flat_order` AS so |
OlderNewer