- There are some situations that are difficult to distinguish mechanically, so I now consider all of those cases problematic, even when they are not obviously wrong.
- You should be coding for readability and error resistance.
- The place to express yourself in programming is in the quality of your ideas, and the efficiency of execution. The role of style is the same as in literature. A great writer doesn't express himself by putting the spaces before his commas instead of after, or by putting extra spaces inside his parentheses.
- Many people think they have good reasons for doing things badly.
- [The purpose of JSLint is not to make you feel good about inadequate coding standards.](http://tech.groups.y
This file contains 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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains 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 getDominantColor(aImg) { | |
let canvas = document.createElement("canvas"); | |
canvas.height = aImg.height; | |
canvas.width = aImg.width; | |
let context = canvas.getContext("2d"); | |
context.drawImage(aImg, 0, 0); | |
// keep track of how many times a color appears in the image | |
let colorCount = {}; |
This file contains 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
// | |
// FMInfoPanelViewController.h | |
// Created by Florian Mielke (@FlorianMielke) on 06.12.11. | |
// | |
#import <UIKit/UIKit.h> | |
#import <Foundation/Foundation.h> | |
#import <QuartzCore/QuartzCore.h> | |
@interface FMInfoPanelViewController : UIViewController <UIScrollViewDelegate> |
Tested against the WebKit git repo by entering the repo with 1 file dirty.
git diff --quiet --ignore-submodules HEAD
# Will tell if there are any uncomitted changes, staged or not.
0.6 sec
git diff-index --quiet HEAD
# Only tracked
2 sec
This file contains 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
#!/bin/sh | |
## | |
# This is a script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# Run in interactive mode with: | |
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)" | |
# | |
# or run it without prompt questions: |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Building a router</title> | |
<script> | |
// Put John's template engine code here... | |
(function () { | |
// A hash to store our routes: |
This file contains 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
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
# | |
# Current known FCC address ranges: | |
# https://news.ycombinator.com/item?id=7716915 | |
# | |
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
# | |
# In your nginx.conf: | |
location / { |
This file contains 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
/* global Application, ObjC, $ */ | |
/** | |
* repozish.js | |
* | |
* this is an example of using os x yosemite's "JavaScript for Automation": | |
* | |
* https://developer.apple.com/library/prerelease/mac/releasenotes/interapplicationcommunication/rn-javascriptforautomation/index.html | |
* | |
* it repositions some windows based on some position settings. you can run |
OlderNewer