Skip to content

Instantly share code, notes, and snippets.

View ryanve's full-sized avatar
📶
stay free

deepskyblue ryanve

📶
stay free
View GitHub Profile
@anzeljg
anzeljg / curl.md
Created October 16, 2012 12:11 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@MoOx
MoOx / background.scss
Created December 12, 2012 08:54
Is there a sort of ternary operator in #Sass ?
//...
$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);
}
//...
@blackfalcon
blackfalcon / sassJunkDrawer.md
Last active March 23, 2022 20:09
Clean out your Sass junk-drawer

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.

Large CSS files and increased complexity

CSS started out with very simple intentions, but as [tableless web design][1.1] began to really take a foothold, o

@stowball
stowball / wp8-ie10-fix.js
Last active April 17, 2022 19:09
Microsoft's stop-gap solution to fix IE 10 & 11's viewport on Windows Phone 8. I've also added another condition so it won't run on other browsers that spoof the user agent. Details: http://mattstow.com/responsive-design-in-ie10-on-windows-phone-8.html
(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);
}
})();
@kvnsmth
kvnsmth / example-subtree-usage.md
Last active March 5, 2023 21:58
A real world usage for git subtrees.

Let's say you have an iOS project, and you want to use some external library, like AFNetworking. How do you integrate it?

With submodules

Add the project to your repo:

git submodule add git@github.com: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 $< > $@
@adrianvlupu
adrianvlupu / JSONP.js
Created June 28, 2013 08:43
JSONP js wrapper
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);
}
@renoirb
renoirb / dabblet.css
Created July 1, 2013 23:49
Lea Verou's CSS Lightbox, taken on webplatform.org
/**
* Lea Verou's CSS Lightbox, taken on webplatform.org
* For redistribution purposes
* @author Lea Verou <lea@w3.org>
*/
#lightbox {
visibility: hidden;
position: fixed;
top: 50%;
left: 50%;
@bobholt
bobholt / resources.md
Last active August 30, 2016 05:24
JavaScript Development Resources

This is a work in progress. If I missed something or someone, please let me know!

Best Practices

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.

Twitter

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:

Developers

@xaviershay
xaviershay / repro-1489.sh
Last active July 25, 2020 22:27
Sample repro script for bundler issues
#!/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]