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
| #!/usr/bin/env python | |
| # Limitations: | |
| # - only the last sender will be shown for a given conversation with | |
| # multiple new messages | |
| # TODO | |
| # - chmod for config file | |
| # - config for every default 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
| ;; Constants | |
| (defconstant *whitespace* '(#\space #\tab #\newline #\return)) | |
| (defconstant *separator* "EOF") | |
| ;; Predicates | |
| (defun whitespace-p (char) | |
| "Returns a given character if it is whitespace, NIL otherwise." |
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 | |
| function mcsf_the_content( $length ) { | |
| $content = get_the_content(); | |
| $content = apply_filters( 'the_content', $content ); | |
| $content = wp_filter_nohtml_kses( $content ); | |
| $extra = substr( $content, $length, $length + 20 ); | |
| $content = substr( $content, 0, $length ); | |
| $matches = array(); | |
| echo $content; |
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
| [allowed_vars] => Array | |
| ( | |
| [0] => m | |
| [1] => p | |
| [2] => posts | |
| [3] => w | |
| [4] => cat | |
| [5] => withcomments | |
| [6] => withoutcomments | |
| [7] => s |
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
| _.mixin({ | |
| flipAll: function(f) { | |
| return function() { | |
| var args = Array.prototype.slice.call(arguments).reverse(); | |
| return f.apply(this, args); | |
| }; | |
| }, | |
| flip: function(f) { | |
| return function() { | |
| var args = Array.prototype.slice.call(arguments), |
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
| fun! run#Run() | |
| if !exists("g:RunPath") | |
| let g:RunPath = input("Run? ") | |
| end | |
| exe "!" . g:RunPath | |
| endfun | |
| nmap <F9> :call run#Run()<cr> |
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
| Collection = Backbone.Collection.extend({ | |
| // ... | |
| autofetch: function(interval, throttle) { | |
| var maybeFetch = function() { | |
| if (! document.hidden) { this.fetch(); } | |
| }.bind(this); | |
| this.fetch = _.throttle(this.fetch, throttle * 1000); |
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 | |
| /** | |
| * Includes a few useful predicates in the bootstrapped `infiniteScroll` JS object | |
| * that is served along with the rest of the document upon initial page request. | |
| */ | |
| add_filter( 'infinite_scroll_js_settings', 'mcsf_extra_js_settings' ); | |
| function mcsf_extra_js_settings( $js_settings ) { | |
| $js_settings['query_args']['extra'] = array( | |
| 'is_home' => is_home(), |
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
| [core] | |
| editor = vim | |
| [push] | |
| # do everyone a favor: | |
| default = simple | |
| #[merge] | |
| #tool = vimdiff |
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
| import { flatten } from 'lodash' | |
| const flatMap = (xs, f) => flatten(xs.map(f)) | |
| /** | |
| * > cartesian([1, 2], [4, 5, 6], [7]) | |
| * [ [ 1, 4, 7 ], | |
| * [ 1, 5, 7 ], | |
| * [ 1, 6, 7 ], | |
| * [ 2, 4, 7 ], | |
| * [ 2, 5, 7 ], |
OlderNewer