- π¨ when improving the format/structure of the code
- π when improving performance
- βοΈ when writing docs
- π‘ new idea
- π§ work in progress
- β when adding feature
- β when removing feature
- π when adding logging
- π when reducing logging
- π when fixing a bug
new Swipe(document.getElementById("gallery"), function(event, direction) { | |
event.preventDefault(); | |
switch (direction) { | |
case "up": | |
// Handle Swipe Up | |
break; | |
case "down": | |
// Handle Swipe Down | |
break; |
curl -L http://bit.ly/10hA8iC | bash |
# first: | |
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
# go to /usr/local/lib and delete any node and node_modules | |
cd /usr/local/lib | |
sudo rm -rf node* |
// Functions and mixin to convert `px` values into `em` units | |
// | |
// px-to-em can easily be changed to `rem` values | |
// Change any instance of `em` to `rem` | |
// | |
// EXAMPLE: | |
// .foo { | |
// @include em(margin, 10px auto); | |
// padding: em(1px 2 3px 4); | |
// } |
<?php | |
/** | |
* Insert an attachment from a URL address. | |
* | |
* @param string $url The URL address. | |
* @param int|null $parent_post_id The parent post ID (Optional). | |
* @return int|false The attachment ID on success. False on failure. | |
*/ | |
function wp_insert_attachment_from_url( $url, $parent_post_id = null ) { |
A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.
Running a local server for testing purposes:
β back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso
<?php | |
/** | |
* YouTube Preg Match Test Case. | |
* | |
* @author Mario "Kuroir" Ricalde | |
*/ | |
// Regular Expression (the magic). | |
$youtube_regexp = "/^http:\/\/(?:www\.)?(?:youtube.com|youtu.be)\/(?:watch\?(?=.*v=([\w\-]+))(?:\S+)?|([\w\-]+))$/"; |