Skip to content

Instantly share code, notes, and snippets.

View njncalub's full-sized avatar
🐣
constantly learning

Nap Joseph Calub njncalub

🐣
constantly learning
View GitHub Profile

Keybase proof

I hereby claim:

  • I am njncalub on github.
  • I am njncalub (https://keybase.io/njncalub) on keybase.
  • I have a public key ASAaUmWF5h89IR7yI0nzRLe9DPJ91RjEw7wi6jfkFkf5oAo

To claim this, I am signing this object:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@njncalub
njncalub / nginx.conf
Last active August 29, 2015 14:26 — forked from asmallteapot/nginx.conf
My default Nginx configuration for serving Django projects.
# file: /etc/nginx/sites-available/example.com
# nginx configuration for example.com
server {
listen 80;
server_name example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
# pass root to django
@njncalub
njncalub / 01 - Installing requirements
Last active August 29, 2015 14:13
Getting started with Titanium
npm install -g titanium alloy tishadow
titanium sdk install
@njncalub
njncalub / index.js
Last active August 29, 2015 14:07
sample usage of the centerImageView.js file
var win, parentView, imageView;
var initView;
// copy the centerImageView code here
initView = function() {
win = Ti.UI.createWindow({
backgroundColor: "#cccccc"
});
parentView = Ti.UI.createView({
@njncalub
njncalub / centerImageView.js
Last active November 16, 2018 00:52
Center a Titanium.UI.ImageView inside a parent Titanium.UI.View similar to a `background-size: cover;` in CSS.
/**
* Center a Titanium.UI.ImageView inside a parent Titanium.UI.View
* similar to a `background-size: cover;` in CSS.
*
* Takes 3 parameters: imageRatio, parentView, and imageView
*
* imageRatio:
* an object with the ratio or actual dimension of the image to be placed in the ImageView.
* e.g. {width: 3, height: 2}
*