Skip to content

Instantly share code, notes, and snippets.

@brainv
brainv / README.md
Created November 29, 2012 08:02
Extract Device ID on iOS Provisioning Portal
@brainv
brainv / fbimages.js
Created December 4, 2012 18:37
Extract facebook images
var images = document.querySelectorAll('a.uiMediaThumb');
for (var i=0; i<images.length; i++) {
var image = unescape(images[i].href).split('=')[4]
console.log(image);
}
// parse philippine mobile network operator from wikipedia
// http://en.wikipedia.org/wiki/Telephone_numbers_in_the_Philippines
function ph_mno(msisdn) {
var links = document.querySelectorAll('ul li a');
var operator = new Array();
for (i=0; i<links.length; i++) {
var string = links[i].parentNode.innerText;
@brainv
brainv / gist:5720493
Created June 6, 2013 09:55
response.headers has no cookie
request({
uri: "https://domain.com/aut/?tsurbanes="+eklabu,
method: "GET",
strictSSL: false
}, function(error, response, body) {
console.log(body);
console.log(response.headers);
console.log(error);
});
var http = require("http");
var soap = require("soap");
var url = 'http://www.w3schools.com/webservices/tempconvert.asmx?wsdl';
var args = {Celsius: '40'};
soap.createClient(url, function(err, client) {
client.CelsiusToFahrenheit(args, function(err, result) {
console.log(result); //This works
});
});
package com.aaplab.android.robird.utils;
import android.view.View;
import com.nineoldandroids.animation.Animator;
import com.nineoldandroids.view.ViewHelper;
import com.nineoldandroids.view.ViewPropertyAnimator;
/**
* Created with IntelliJ IDEA.
* User: user

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin

Set-up remote git repository on a standard server

The first thing to do is to install Git on the remote server.

Once you do that the rest of the process is split into three sections:

  1. Server set-up
  2. Local set-up (push commits)
  3. Server (pull commits)
@brainv
brainv / tmux.md
Created January 22, 2014 20:13 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: