Skip to content

Instantly share code, notes, and snippets.

@40
40 / gist:2355341
Created April 10, 2012 22:56
SSL Install Resources APACHE2
CONFIGURATION
http://www.tc.umn.edu/~brams006/selfsign_ubuntu.html
ADDITIONAL INFO
http://mikebeach.org/2011/05/04/ubuntu-apache-virtualhosts-and-ssl/
@40
40 / gist:2356290
Created April 11, 2012 01:48
Prevent Directory Listing on Apache2
# Find sites-available directory
# Open default dir
# Locate something like <Directory /[some directory name]>
# Change "Indexes" to "-Indexes"
:wq
service apache2 restart
@40
40 / slides.html
Created May 8, 2012 01:55
Backup mysql database
mysql -u root -pPASSWORD DATABASENAME < backupfile.sql
@40
40 / gist:2822646
Created May 29, 2012 05:01
get full content of last blog others just the title
<?php
$args = array( 'numberposts' => '1' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' . $recent["post_title"].'</a> </li> ';
}
?>
@40
40 / gist:2901820
Created June 9, 2012 17:06
Build Log Output BB10 Twitter
// Downloaded Source from GitHub
// Imported Project
// Updated Debug Token
// Edited Consumer & Secret for my app
// Save
// Build
**** Build of configuration Default for project twitter ****
make all
@40
40 / application_swipedown.cpp
Created June 28, 2012 03:46
Swipe Down BB10 Cascades Application
#include <bb/Application>
#include <QtCore/QObject>
#include <QtCore/QString>
class TestObject: public QObject {
Q_OBJECT
public Q_SLOTS:
void swiped();
};
@40
40 / bb10ledcontrolcode.cpp
Created June 28, 2012 18:10
Activating BlackBerry 10 LED Light(Cascades)
// app.cpp
// include these in your header
#include <bb/device/Led>
#include <bb/device/LedColor>
#include <bb/device/Light>
// add this namespace
using namespace bb::device;
@40
40 / FileBrowse.hpp
Created June 29, 2012 05:58
Browse File System on BB10 Cascades Snippet
#ifndef FILEBROWSEDIALOG_HPP_
#define FILEBROWSEDIALOG_HPP_
#include <QThread>
#include <QVariant>
#include <bps/dialog.h>
/*
* The file browse dialog displays a dialog to browse and select
* files from shared folders on the system.
@40
40 / dropdown.qml
Created June 30, 2012 07:41
All US States DropDown Component Snippet - BB10 Cascades
DropDown {
title : "Choose a state"
enabled : true
onSelectedIndexChanged: {
console.log ("SelectedIndex was changed to " + selectedIndex);
}
Option {
text: "Alabama"
value: "AL"
}
@40
40 / canadianProvincesDropDown.qml
Created June 30, 2012 08:08
Canadian Provinces(States) DropDown Component - BB10 Cascades
DropDown {
title: "Choose a province"
enabled: true
onSelectedIndexChanged: {
console.log ("SelectedIndex was changed to " + selectedIndex);
}
Option {
text: "British Columbia"
value: "BC"
}