Skip to content

Instantly share code, notes, and snippets.

@iwek
iwek / tsv-to-json.js
Last active March 20, 2023 02:46
TSV to JSON Conversion in JavaScript
//var tsv is the TSV file with headers
function tsvJSON(tsv){
var lines=tsv.split("\n");
var result = [];
var headers=lines[0].split("\t");
for(var i=1;i<lines.length;i++){
@nanchu
nanchu / rosechart.haml
Created October 5, 2012 04:50
Create a Rose Chart using ONLY HAML and SASS
.chartWrapper
- @chart = [[1, "Label 1"], [2, "Label 2"], [3, "Label 3"], [4, "Label 4"], [5, "Label 5"], [6, "Label 6"]]
- @chart.each do |chart, label|
%div{:class=>"chartContainer#{chart}"}
%div{:class=>"hold#{chart}", :id=>"chartSlice#{chart}"}
%div{:class=>"chart#{chart}"}
.label{:id=>"label#{chart}"}
%span #{label}
@chriseppstein
chriseppstein / 0_content_block_scoping.scss
Created August 12, 2012 23:28
This gist demonstrates how global and local variables work with mixin content blocks in Sass.
$global: one;
@mixin foo {
$local: 1;
$mixin-local: true;
global-before-content: $global;
mixin-local-before-content: $local;
@content;
@ctdk
ctdk / github.js.diff
Created June 13, 2012 17:39
Diff to fix Octopress' github.js to make it not use the deactivated Github v2 API
diff --git a/source/javascripts/github.js b/source/javascripts/github.js
index 678775a..bc4c9bd 100644
--- a/source/javascripts/github.js
+++ b/source/javascripts/github.js
@@ -3,22 +3,22 @@ var github = (function(){
var i = 0, fragment = '', t = $(target)[0];
for(i = 0; i < repos.length; i++) {
- fragment += '<li><a href="'+repos[i].url+'">'+repos[i].name+'</a><p>'+repos[i].description+'</p></li>';
+ fragment += '<li><a href="'+repos[i].html_url+'">'+repos[i].name+'</a><p>'+repos[i].description+'</p></li>';
@alexgibson
alexgibson / enableActivePseudoStyles.js
Created January 30, 2012 13:57
hack to enable active pseudo styles in mobile webkit
//enable active pseudo styles in mobile webkit. Only required if not already using touch events
function enableActivePseudoStyles() {
document.addEventListener("touchstart", function () {}, false);
}
@geekontheway
geekontheway / README.md
Created December 7, 2011 05:29 — forked from napcs/README.md
Deploying Rails to Linode

Deploying Rails to Linode

Installing Ruby Enterprise Edition, Apache, MySQL, and Passenger for deploying Rails 3.0 applications.

Get a Linode, and set it up with Ubuntu 10.04 LTS so that you have till April 2013 to get updates. Once the Linode is formatted, boot it and continue on.

Set up an 'A' record in your DNS, pointing to the IP of your Linode. I'm using demo.napcs.com here.

Initial setup

@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

.box {
-moz-box-shadow: 5px 9px 5px 5px rgba(0, 0, 0, 0.75);
-webkit-box-shadow: 5px 9px 5px 5px rgba(0, 0, 0, 0.75);
-o-box-shadow: 5px 9px 5px 5px rgba(0, 0, 0, 0.75);
box-shadow: 5px 9px 5px 5px rgba(0, 0, 0, 0.75);
}
@yomotsu
yomotsu / _mixin_linear-gradient.scss
Created May 14, 2011 07:22
sass @Minxin linear-gradient() including SVG code for IE9
@mixin linear-gradient($angle, $color1, $offset1, $color2 ,$offset2:100, $color3:null, $offset3:100, $color4:null, $offset4:100, $color5:null, $offset5:100){
$angle_webkit:'left top, left bottom';
$angle_svg:'%20x2%3d%220%25%22%20y2%3d%22100%25%22';
$color-stop1_css:'#'#{$color1}' '#{$offset1}'%';
$color-stop2_css:',#'#{$color2}' '#{$offset2}'%';
$color-stop3_css:'';
$color-stop4_css:'';
$color-stop5_css:'';
$color-stop1_svg:'%3cstop%20style%3d%22stop%2dcolor%3a%23'#{$color1}'%22%20offset%3d%22'#{$offset1}'%25%22%2f%3e';
$color-stop2_svg:'%3cstop%20style%3d%22stop%2dcolor%3a%23'#{$color2}'%22%20offset%3d%22'#{$offset2}'%25%22%2f%3e';
@wolfeidau
wolfeidau / sass_converter.rb
Created May 7, 2011 02:43
Sass plugin for Jekyll
module Jekyll
# Sass plugin to convert .scss to .css
#
# Note: This is configured to use the new css like syntax available in sass.
require 'sass'
class SassConverter < Converter
safe true
priority :low
def matches(ext)