Skip to content

Instantly share code, notes, and snippets.

🤷‍♂
Thinking, maybe?

Idan Gazit idan

🤷‍♂
Thinking, maybe?
Block or report user

Report or block idan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@idan
idan / gist:9596928
Created Mar 17, 2014
Python ISO week for date
View gist:9596928
import datetime
def week_for_date(target):
"""Given a target date, return a start and end for that date's ISO week.
The returned tuple includes two datetime.date's, (start, end):
start: midnight on the first day of the ISO week containing the target
end: midnight on the first day following the ISO week containing the target
Note that the end date represents the first date _not_ in the target week,
View component.jsx.hbs
import './style.scss'
import React, { PropTypes } from 'react'
export default class {{ componentName }} extends React.Component {
static propTypes = {
};
static defaultProps = {
};
@idan
idan / gist:1385165
Created Nov 22, 2011
rel=logo enhancements
View gist:1385165
<!--
rel=logo is lovely.
I have a few ideas on making it better. The core idea is great, but if we're
pushing a new thing, we have an opportunity to encourage web developers to
provide more than just a single color logo. All of the ideas below are optional
enhancements for anybody wanting to use rel=logo on their site.
-->
View gist:3135754

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

Now back to me. That grey text is a link! Open that sucker in a new tab to see the source for this post. Also, I'm on a horse.

This is a major heading

If you peek at it with a web inspector, you'll see that it is a second-level heading. You can use first level headings, but they'll look just like the second level ones, and the gods of the HTML5 outlining algorithm will frown upon you.

@idan
idan / gfm.md
Created Aug 13, 2013
GFM Sample
View gfm.md

GitHub Flavored Markdown

View the source of this content.

Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:

Roses are red Violets are blue

@idan
idan / simpleframeless.scss
Created Jan 11, 2012
My simplified take on Joni Korpi's Frameless
View simpleframeless.scss
/*
Simplified Frameless
Based on Frameless by Joni Korpi <http://framelessgrid.com/>
licensed under CC0 <http://creativecommons.org/publicdomain/zero/1.0/>
*/
$font-size: 18; // Your base font-size in pixels
$em: $font-size; // Shorthand for outputting ems
$column: $font-size * 3; // The column-width of your grid in pixels
View _more.scss
$less-column-width: 68px;
$less-gutter-width: 24px;
@function column-width($columns) {
@return ($less-column-width * $columns) + ($less-gutter-width * ($columns - 1));
}
@function grid-padding-px($columns) {
@if $columns == 10 {
@return 48px;
@idan
idan / gist:c27b2dd45a78273af848
Created Oct 8, 2014
Exploding Postgres HSTORE columns in Pandas
View gist:c27b2dd45a78273af848
def explode_hstore(df, column):
"""Explode a column of a dataframe containing PostgreSQL hstore k-v pairs in the format of:
"foo"=>"bar", "baz"=>"quux", ...
Every key becomes a column. If a given row's pairs doesn't have a key, then the resulting column's value
will contain NaN.
"""
# split the tags column out as a new series, and break up each k=>v pair
s = df[column].str.split(', ').apply(pd.Series, 1).stack()
@idan
idan / gist:3890040
Created Oct 14, 2012
Why Fonts.com Sucks
View gist:3890040

For reasons passing understanding, fonts.com has the most brain-dead approach to serving up webfonts, making each weight in a family its own family. On the face of things, that doesn't seem so bad, right?

Wrong.

Imagine that you're using two actually distinct families, say, Helvetica Neue and its lovely condensed cousin. For each family, you use two weights, plus maybe an italic cut. Now we have:

  • Helvetica Neue Light
  • Helvetica Neue Light Italic
  • Helvetica Neue Medium
  • Helvetica Neue Medium Italic
@idan
idan / impostor.md
Created May 26, 2013
Hybrid Impostor Syndrome
View impostor.md

I'm a hybrid designer/developer, but I socialize with more developers than designers—at conferences, online, etc. I have a very specific form of impostor syndrome. I think it might be instructive when examining impostor syndrome, in the same way that optical illusions can be instructive when examining the workings of perception.

I am not a rockstar designer. Or, for that matter, developer. Or anything, really. I am talented, and I feel that I could be a badass at something. Looking around me at tech conferences and our erstwhile online communities, I think this is a feeling that a lot of us share. We're all looking for that outlet, that thing that we would be a game-changer at doing. In our heads, we fantasize about being some kind of Michael Jordan of X, or maybe something with less glamor. A savant-like rain-man at content marketing, or scalable API design, or documentation, or low-latency concurrent network development, or whatever it is that we think we like doing.

As a designer at developer conference

You can’t perform that action at this time.