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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
/* CSS */ | |
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 request = require("request"), | |
cheerio = require("cheerio"), | |
root = "http://gamemusic.siroro.co.uk/"; | |
function process(url, dir) { | |
request(url, function(error, response, body) { | |
if (!error) { | |
var $ = cheerio.load(body), | |
filenames = $("span.file-name"), | |
alert = $("div.alert")[0]; |
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
# Using Mac you will need importing cooffe-script library: | |
sudo npm install -g coffee-script | |
# now you can convert cooffee-scripts ("compressed" version of a normal javascript file) into more familiar JS, i.e | |
coffee -c --output gamejs/ game/ | |
#which converts all file into game/ in a new directory called gamejs/. |
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
add_action( 'wp_ajax_button_click', 'user_clicked' ); | |
function user_clicked() { | |
update_user_meta( get_current_user_id(), 'clicked_link', 'yes' ); | |
wp_redirect( $_SERVER['HTTP_REFERER'] ); | |
exit(); | |
} |
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
<?php | |
/** You could put this in the bp-custom.php file | |
* @see http://codex.buddypress.org/themes/bp-custom-php/ | |
*/ | |
function custom_bbpress_maybe_load_mentions_scripts( $retval = false ) { | |
if ( function_exists( 'bbpress' ) && is_bbpress() ) { | |
$retval = true; | |
} | |
return $retval; |
Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.
Prerequisites (for Homebrew at a minimum, lots of other tools need these too):
- XCode is installed (via the App Store)
- XCode command line tools are installed (
xcode-select --install
will prompt up a dialog) - Java
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
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
<?PHP | |
/** | |
* Spintax - A helper class to process Spintax strings. | |
*/ | |
class Spintax | |
{ | |
/** | |
* Set seed to make the spinner predictable. | |
*/ |
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
<?php | |
/******************************** | |
This code will allow you to create your own shortcode. | |
*************************************/ | |
// SHORTCODE FOR GOOGLE ADSENSE |
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
<?php | |
$file = '/path/to/file.png'; | |
$filename = basename($file); | |
$upload_file = wp_upload_bits($filename, null, file_get_contents($file)); | |
if (!$upload_file['error']) { | |
$wp_filetype = wp_check_filetype($filename, null ); | |
$attachment = array( | |
'post_mime_type' => $wp_filetype['type'], | |
'post_parent' => $parent_post_id, |