Skip to content

Instantly share code, notes, and snippets.

View heitara's full-sized avatar
💻
Swift & SwiftUI

Emil Atanasov heitara

💻
Swift & SwiftUI
View GitHub Profile
/***
* 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;
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();
<?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) {
import java.security.MessageDigest;
buildscript {
repositories {
mavenCentral()
}
}
task rename(type: Copy) {
from 'in'
#define TICK NSDate *startTime = [NSDate date]
#define TOCK NSLog(@"%s Time: %f", __PRETTY_FUNCTION__, -[startTime timeIntervalSinceNow])
//then use as follows
//TICK;
//do stuff
//TOCK;