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(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) { | |
/******/ return installedModules[moduleId].exports; |
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
var express = require('express') | |
, app = express() | |
app.engine('jade', require('jade').__express) | |
app.set('view engine', 'jade') | |
app.use(express.static(__dirname + '/public')) | |
app.use(require('./controllers')) | |
app.listen(3000, function() { |
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.example.package.name; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
public class Server { | |
public static class Result { | |
public int code; |
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 "Utilities.h" | |
@implementation Utilities | |
+ (CGSize)text:(NSString *)text sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size { | |
if(IOS_NEWER_OR_EQUAL_TO_7) { | |
CGRect frame = [text boundingRectWithSize: size | |
options: (NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) | |
attributes: @{NSFontAttributeName: font} | |
context:nil]; |
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 android.content.Context; | |
import android.util.TypedValue; | |
public class Util { | |
public static int dp(Context context, int size) { | |
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, | |
size, | |
context.getResources().getDisplayMetrics()); | |
} | |
} |
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; | |
import java.security.NoSuchAlgorithmException; | |
public class Util { | |
private static char[] hex = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; | |
/** | |
* Transform any string to MD5 hash and then to HEX representation. | |
* Very useful for using strings as file names, like when the string | |
* is a url or another arbitrary string. |