This file contains hidden or 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 | |
/** | |
* Model for interfacing with a Wordpress backend | |
* | |
* @author Alex Crooks, Si digital http://sidigital.co | |
**/ | |
// Just replace your WordPress index.php content with this code to test. | |
define('APP_PATH', dirname( __FILE__ )); |
This file contains hidden or 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
/** | |
* Disable the Visual and Text Editor p and br tag modifications when saving | |
* | |
* When you call the editor, it will automatically add a filter depending | |
* on which editor you have open: | |
* * Text Editor: add_filter('the_editor_content', 'wp_htmledit_pre'); | |
* * Visual Editor: add_filter('the_editor_content', 'wp_richedit_pre'); | |
* | |
* The only way to stop this is to remove the filter because it's applied. | |
* The next call after is do_action( 'media_buttons', $editor_id ); |
This file contains hidden or 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 lang="en" style="overflow: auto; height: 100%;"> | |
<body style="background: #222222; margin: 0; height: 100%;"> | |
<div style="overflow: hidden; height: 100%;"> | |
<img id="background-image" src="https://www.gstatic.com/chat/hangouts/bg/a432eb7bf6eef1cccf7946ca20e5c2c0-NeilKremer.jpg"> | |
</div> | |
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script> | |
<script type="text/javascript"> |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"reflect" | |
"strings" | |
) | |
func main() { | |
// Arrays, slices (and strings) |
This file contains hidden or 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
package main | |
import ( | |
"bufio" | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"fmt" | |
"io" | |
"io/ioutil" |
This file contains hidden or 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
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"os" |
This file contains hidden or 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
/* | |
******************************************************************************** | |
Golang - Asterisk and Ampersand Cheatsheet | |
******************************************************************************** | |
Also available at: https://play.golang.org/p/lNpnS9j1ma | |
Allowed: | |
-------- | |
p := Person{"Steve", 28} stores the value |
This file contains hidden or 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
// Also available at: https://play.golang.org/p/yTTpB5gB6C | |
package main | |
import ( | |
"fmt" | |
) | |
// ***************************************************************************** | |
// Example 1 - Struct vs Struct with Embedded Type |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
// Make a channel for the spinner |
This file contains hidden or 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
/* | |
fmt.Println(Bitmask(0x6).IsSet(0x2)) | |
fmt.Println(Bitmask(f.FileHeader.Characteristics).ListDescriptions(charValues)) | |
fmt.Println(Bitmask(f.FileHeader.Characteristics).ListValues(charValues)) | |
*/ | |
type Bitmask uint16 | |
// BitValue is a value and a description | |
type BitValue struct { |