This file contains hidden or 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
/*** | |
* A script which updates the bibliography numbering if there are some extra recorrd. | |
* For example if you have added extra [2.1] and [4.1], the script will | |
* go trhou it and will make [2.1] to [3] and [4.1] to [5], because [4] is already [5] | |
* The script will print the mapping as well. | |
**/ | |
function updateBibliography() { | |
var bodyElement = DocumentApp.getActiveDocument().getBody(); | |
//initial max number or reference, to generate the mapping | |
var max = 30; |
This file contains hidden or 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 Picasso getImageLoader(Context ctx) { | |
if(sPicassoInstance == null) { | |
Picasso.Builder builder = new Picasso.Builder(ctx); | |
sTransformRequest = new Picasso.RequestTransformer() { | |
@Override | |
public Request transformRequest(Request request) { | |
Uri uri = request.uri; | |
if(uri.getScheme().startsWith("http")) { | |
String urlString = uri.toString(); |
This file contains hidden or 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 | |
// Connects to your Database | |
mysql_connect("localhost", "user", "password") or die(mysql_error()); | |
mysql_select_db("database") or die(mysql_error()); | |
$data = mysql_query("select * from table order by created_at desc limit 1, 2000;") | |
or die(mysql_error()); | |
$row = mysql_fetch_assoc($data); | |
print '<table><tr>'; | |
foreach($row as $name => $value) { |
This file contains hidden or 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 java.security.MessageDigest; | |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
} | |
task rename(type: Copy) { | |
from 'in' |
This file contains hidden or 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
#define TICK NSDate *startTime = [NSDate date] | |
#define TOCK NSLog(@"%s Time: %f", __PRETTY_FUNCTION__, -[startTime timeIntervalSinceNow]) | |
//then use as follows | |
//TICK; | |
//do stuff | |
//TOCK; |
NewerOlder