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 class IntentUtilities { | |
/** | |
* <p>Intent to open the official Facebook app. If the Facebook app is not installed then the | |
* default web browser will be used.</p> | |
* | |
* https://stackoverflow.com/questions/4810803/open-facebook-page-from-android-app | |
* | |
* <p>Example usage:</p> | |
* | |
* {@code newFacebookIntent(ctx.getPackageManager(), "https://www.facebook.com/JRummyApps");} |
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
[Unit] | |
Description=High-performance, schema-free document-oriented database | |
After=network.target | |
[Service] | |
User=mongodb | |
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf | |
[Install] | |
WantedBy=multi-user.target |
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 | |
USER="vagrant" | |
MYSQL_PASSWORD="admin" | |
# Update & Install Prerequisites | |
apt-get update | |
apt-get install -y debconf-utils | |
# Install nginx |
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 | |
# Install the Build and Test Dependencies | |
apt-get update | |
apt-get install -y curl build-essential tcl | |
# Download and Extract the Source Code | |
cd /tmp | |
curl -O http://download.redis.io/redis-stable.tar.gz | |
tar xzvf redis-stable.tar.gz |
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 | |
apt-get install -y debconf-utils htop build-essential curl | |
# Install nginx server | |
apt-get install -y nginx | |
# Install and configure mysql server | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password admin' | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password admin' |
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
# Install Postgresql | |
sudo apt-get install -y postgresql postgresql-contrib | |
# Create a database and a user to access it | |
# this will prompt you for a database password | |
sudo -u postgres createuser -P USER_NAME_HERE | |
sudo -u postgres createdb -O USER_NAME_HERE DATABASE_NAME_HERE | |
# Test connecting to Postgresql | |
psql -h localhost -U USER_NAME_HERE DATABASE_NAME_HERE |
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
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
ServerName [SERVER_NAME] | |
ServerAlias [SERVER_ALIAS] | |
DocumentRoot [SERVER_DOCUMENT_ROOT] | |
<Directory /> | |
AllowOverride All | |
</Directory> | |
<Directory [SERVER_DOCUMENT_ROOT]> | |
Options Indexes FollowSymLinks MultiViews |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Upload Photos</title> | |
<link rel="stylesheet" type="text/css" href="bower_components/bootstrap/dist/css/bootstrap.min.css"/> | |
<style type="text/css"> | |
.fileUpload { | |
position: relative; |
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 LfsrCipher = function(s, p) { | |
this.key = s; | |
this.p = p; | |
this.generate = function(i) { | |
var t = 0; | |
for(var j=0; j<=p.length-1; j++) | |
t += p[j] * s[i+j]; | |
t = t % 2; |
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
unsigned char* hex2bin(const char* hexstr, size_t* size) | |
{ | |
size_t hexstrLen = strlen(hexstr); | |
size_t bytesLen = hexstrLen / 2; | |
unsigned char* bytes = (unsigned char*) malloc(bytesLen); | |
int count = 0; | |
const char* pos = hexstr; |
NewerOlder