An introduction to curl using GitHub's API
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
//... | |
$background: null; // if you don't do this, background is undefined out of the @if/else scope | |
@if ($direction) { | |
$background: linear-gradient($direction, $color, $color2); | |
} | |
@else { | |
$background: linear-gradient($color, $color2); | |
} | |
//... | |
by Dale Sande
CSS has had a long and sordid past. A developer never sets out with the goal of making a complete and total mess of things. Their intention is not to build something that is practically illegible, impractical to maintain and is limited in scale. But somehow, this is where many inevitably end up. Luckily, all is not lost. With some simple strategies, organizational methods and out-of-the box tools, we can really help get that junk-drawer inline.
For many of us getting started with Sass, at one time or another have created a junk-drawer of files. For most, this was a rookie mistake, but for others, this is a continuing issue with our architecture and file management techniques. Sass doesn't come with any real rules for file management so developers are pretty much left to their own devices.
CSS started out with very simple intentions, but as [tableless web design][1.1] began to really take a foothold, o
(function() { | |
if ("-ms-user-select" in document.documentElement.style && navigator.userAgent.match(/IEMobile/)) { | |
var msViewportStyle = document.createElement("style"); | |
msViewportStyle.appendChild( | |
document.createTextNode("@-ms-viewport{width:auto!important}") | |
); | |
document.getElementsByTagName("head")[0].appendChild(msViewportStyle); | |
} | |
})(); |
Let's say you have an iOS project, and you want to use some external library, like AFNetworking. How do you integrate it?
Add the project to your repo:
git submodule add [email protected]:AFNetworking/AFNetworking.git Vendor/AFNetworking
or something to that effect.
BIN = ./node_modules/.bin | |
SRC = $(wildcard src/*.coffee) | |
LIB = $(SRC:src/%.coffee=lib/%.js) | |
build: $(LIB) | |
lib/%.js: src/%.coffee | |
@mkdir -p $(@D) | |
@$(BIN)/coffee -bcp $< > $@ |
var JSONP = { | |
_jsonpcallbacks: {}, | |
request: function (url, data, callback) { | |
var callbackName = Math.random(); | |
Ripple._jsonpcallbacks[callbackName] = callback; | |
var script = document.createElement('script'); | |
script.src = url + '?callback=' + callbackName + '&data=' + encodeURIComponent(JSON.stringify(data)); | |
script.type = 'text/javascript'; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
} |
/** | |
* Lea Verou's CSS Lightbox, taken on webplatform.org | |
* For redistribution purposes | |
* @author Lea Verou <[email protected]> | |
*/ | |
#lightbox { | |
visibility: hidden; | |
position: fixed; | |
top: 50%; | |
left: 50%; |
This is a work in progress. If I missed something or someone, please let me know!
It's hard to recommend best practices in general without context, but basically, writing clean, readable code with lots of comments, and doing a lot of automated unit testing, followed by an automated build process using ANT or Grunt to concatenate and minify files is a start.
I don't focus much on blogs any more. I focus more on Twitter. If the people I follow there recommend something, I'll go read it. Here's the best of my Twitter list, including developers, conferences, and interesting groups. There are other great developers on Twitter, but these tweet mostly about development:
#!/bin/bash | |
set -ex | |
mkdir -p /tmp/repro-1489 | |
cd /tmp/repro-1489 | |
bundle env | |
# Bundler 1.3.5 | |
# Ruby 2.0.0 (2013-06-27 patchlevel 247) [x86_64-darwin12.4.0] |