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
#define TICK NSDate *startTime = [NSDate date] | |
#define TOCK NSLog(@"%s Time: %f", __PRETTY_FUNCTION__, -[startTime timeIntervalSinceNow]) | |
//then use as follows | |
//TICK; | |
//do stuff | |
//TOCK; |
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 java.security.MessageDigest; | |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
} | |
task rename(type: Copy) { | |
from 'in' |
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 | |
// 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 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 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 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
ln -s /usr/local/lib/node_modules/nodewebkit/nodewebkit/node-webkit.app/Contents/MacOS/node-webkit /usr/local/bin/nw |
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
<inputsourcedef> | |
<name>MY_BULGARIAN_PHONETIC</name> | |
<inputsourceid_prefix>com.apple.keylayout.Bulgarian-Phonetic</inputsourceid_prefix> | |
</inputsourcedef> | |
<item> | |
<name>Bulgarian Phonetic map 'ч' to ± </name> | |
<appendix>Bulgarian Phonetic map 'ч' from '`' to ±. This is valid when you get used with US layout and then switch to UK</appendix> | |
<identifier>private.bulgarina.phonetic</identifier> | |
<inputsource_only><MY_BULGARIAN_PHONETIC<name /></MY_BULGARIAN_PHONETIC></inputsource_only> |
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
#target Illustrator | |
// script.name = exportLayersAsCSS_PNGs.jsx; | |
// script.description = mimics the Save for Web, export images as CSS Layers (images only); | |
// script.requirements = an open document; tested with CS5 on Windows. | |
// script.parent = carlos canto // 05/24/13; All rights reseved | |
// script.elegant = 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
AT Austria | |
BE Belgium | |
BG Bulgaria | |
HR Croatia (Hrvatska) | |
CZ Czech Republic | |
DK Denmark | |
FI Finland | |
FR France | |
DE Germany | |
GB Great Britain (UK) |
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 | |
#slice mp3 file to 30 sec or less starting from the passed begginning | |
if [ "$#" -eq 2 ] && [ -n "$1" ] | |
then | |
DURATION=30 | |
ffmpeg -ss $2 -i "$1" -t $DURATION -acodec copy "$1.output.mp3" | |
else | |
echo | |
echo |
OlderNewer