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
| var page = require ('webpage').create(); | |
| page.viewportSize = { | |
| width: 2560, | |
| height: 1440 | |
| }; | |
| page.open('http://seesparkbox.com', function(status) { | |
| console.log("Status:", status); | |
| if(status === "success") { |
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
| $().ready(function() { | |
| $('.entry-body img').each(function(){ | |
| var $permalink = $(this).parents('.entry').find('.permalink').attr('href'); | |
| $(this).wrap('<div class="pinme" style="' + $(this).attr('style') + '" />').after('<a href="http://pinterest.com/pin/create/button/?url=' + $permalink + '&media=' + $(this).attr('src') + '&description=' + $(this).attr('alt') + '" class="pin-it-button" count-layout="vertical">Pin It</a>'); | |
| }); | |
| $('.pinme').hover(function() { | |
| $(this).children('iframe').css('display','block'); | |
| }, function() { | |
| $(this).children('iframe').css('display','none'); |
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
| This only works with fully public profiles – try accessing the profile while logged-out of Facebook first. | |
| Start with the username for a user. Let's try "thestrokes", from <https://www.facebook.com/thestrokes> | |
| Note that you have to provide a user agent; it doesn't like curl's default. Also use -L to follow redirects. | |
| curl -L -A 'Firefox' https://graph.facebook.com/thestrokes | |
| gives us this: |
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
| <script> | |
| $(window).resize(function() { | |
| var windowWidth = $(window).width(); | |
| var bodyFontSize = $('body').css('font-size'); | |
| var bodyFontSizeWithoutPx = parseInt(bodyFontSize); | |
| var emValue = windowWidth/bodyFontSizeWithoutPx; | |
| $('.screen-width').text(emValue + 'em'); | |
| }); | |
| </script> |
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
| function zipit { | |
| local filename=$1 | |
| if [ -z "$filename" ] ; then | |
| filename=${PWD##*/}"-latest" | |
| fi | |
| git archive HEAD --format=zip > ~/Desktop/${filename}.zip | |
| } |
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
| <script> | |
| $(window).resize(function() { | |
| var windowWidth = $(window).width(); | |
| $('.screen-width').text(windowWidth + 'px'); | |
| }); | |
| </script> | |
| <div id="debug" style="position:fixed;padding:0.3em 0.6em;background:#f1f1f1;font-size:0.6em;bottom:0;left:50%;"> | |
| <span class="screen-width">0</span> | |
| </div> |
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
| { | |
| "bold_folder_labels": true, | |
| "close_windows_when_empty": true, | |
| "color_scheme": "Packages/Theme - Aqua/Color Schemes/Tomorrow Night Aqua.tmTheme", | |
| "detect_indentation": false, | |
| "detect_slow_plugins": false, | |
| "draw_centered": false, | |
| "fade_fold_buttons": false, | |
| "font_face": "Menlo", | |
| "font_size": 14.0, |
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
| require "siteleaf" | |
| require "yaml" | |
| # API settings | |
| Siteleaf.api_key = '...' | |
| Siteleaf.api_secret = '...' | |
| # site settings | |
| site_id = '...' | |
| page_id = '...' # blog page to import posts into |
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
| // PhantomJS Cheatsheet | |
| $ brew update && brew install phantomjs // install PhantomJS with brew | |
| phantom.exit(); | |
| var page = require('webpage').create(); | |
| page.open('http://example.com', function() {}); | |
| page.evaluate(function() { return document.title; }); |
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 | |
| /** | |
| * Rename "Posts" to "News" | |
| * | |
| * @link http://new2wp.com/snippet/change-wordpress-posts-post-type-news/ | |
| */ | |
| add_action( 'admin_menu', 'pilau_change_post_menu_label' ); | |
| add_action( 'init', 'pilau_change_post_object_label' ); | |
| function pilau_change_post_menu_label() { |
OlderNewer