⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
# Based Loosely on this VB script using a commercial ActiveX object to interrogate the registry. | |
# http://www.motobit.com/help/regedit/sa117.htm | |
Get-ChildItem HKLM:\SOFTWARE\Classes\CLSID | ForEach-Object { | |
$regKey = $_; | |
if ($regKey.GetValue('OLEDB_SERVICES') -ne $null -and $regKey.OpenSubKey("OLE DB Provider") -ne $null) { | |
New-Object PSObject -Property @{ | |
'Key' = $regKey.GetValue(""); | |
'OLEDBProvider' = $regKey.OpenSubKey("OLE DB Provider").GetValue(""); | |
}; | |
} |
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 | |
/*-----------------------------------------------------------------------------------*/ | |
/* Conditional Logic to Detect Various Event Related Views/Pages | |
/*-----------------------------------------------------------------------------------*/ | |
if( tribe_is_month() && !is_tax() ) { // Month View Page | |
echo 'were on the month view page'; | |
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page |
Go to Sublime Text 2 > Preferences > Key Bindings - User
and add this JSON to the file:
[
{ "keys": ["super+shift+l"],
"command": "insert_snippet",
"args": {
"contents": "console.log(${1:}$SELECTION);${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
<?php | |
// put this is functions.php | |
define('MAX_POST_WORD_COUNT', 200); // change this to set the maximum word count | |
add_action('save_post', 'limit_post_word_count'); // run the check whenever a post is created or saved using any method | |
function limit_post_word_count ($post) | |
{ | |
if (str_word_count($post->post_content) > MAX_POST_WORD_COUNT) |
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
function Read-ApacheLog | |
{ | |
param( | |
[Parameter(Mandatory=$true)] | |
[string] | |
$Path | |
) | |
Get-Content -Path $Path | Foreach-Object { | |
# combined format |
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 | |
/* PLACE THE FOLLOWING IN YOUR THEME'S FUNCTIONS.PHP FILE. */ | |
add_action( 'tribe_eb_after_event_creation', 'my_change_tribe_eventbrite_currency', 10, 4 ); | |
function my_change_tribe_eventbrite_currency( $eventbrite_id, $venue_id, $organizer_id, $post_id ) { | |
// See http://www.currencysystem.com/codes/ for a list of three-letter | |
// currency acronyms. Change the below variable to your preference. | |
$currency_acro = 'EUR'; | |
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
#requires -version 2 | |
<# | |
.SYNOPSIS | |
<Overview of script> | |
.DESCRIPTION | |
<Brief description of script> | |
.PARAMETER <Parameter_Name> | |
<Brief description of parameter input required. Repeat this attribute if required> |
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
#include <Wire.h> | |
#define ADDRESS 0x21 | |
void setup(){ | |
Wire.begin(); | |
Serial.begin(9600); | |
while(!Serial); | |
calibrate(); | |
} |
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 | |
# PiTFT Resistive 2.8" (PID 1601) or Capacitive 2.8" (PID 1983) setup script or Resistive 3.5" (PID 2097) or 2.2" No-Touchscreen setup script! | |
set -e | |
function cleanup() { | |
if [ "${mountpoint}" != "/" ] | |
then | |
sudo -n umount "${mountpoint}/boot" 2> /dev/null |
OlderNewer