Skip to content

Instantly share code, notes, and snippets.

View vsaarinen's full-sized avatar

Ville Saarinen vsaarinen

View GitHub Profile
@vsaarinen
vsaarinen / zendesk.d.ts
Created November 4, 2019 09:44
TypeScript definitions for the Zendesk Web Widget
interface ZendeskWidget {
(
type: 'webWidget:on' | 'webWidget' | 'webWidget:get',
command: string,
payload?: any,
): void;
(
type: 'webWidget',
command: 'updateSettings',
payload: ZendeskSettings,
@vsaarinen
vsaarinen / grid-styled.d.ts
Created September 19, 2017 09:56
TypeScript type definitions for grid-styled
import * as React from 'react';
type NumberStringOrArray = number | string | number[] | string[];
interface BoxProps {
width?: NumberStringOrArray;
m?: NumberStringOrArray;
mt?: NumberStringOrArray;
mr?: NumberStringOrArray;
mb?: NumberStringOrArray;
@vsaarinen
vsaarinen / react-dom-example.tsx
Created August 30, 2017 13:58
Combining React and D3 by letting React manage the DOM
import { scaleLinear } from 'd3-scale';
import * as React from 'react';
interface Props {
data: number[];
width: number;
height: number;
}
export default function BarChart({ width, height, data }: Props) {
@vsaarinen
vsaarinen / d3-dom-example.tsx
Created August 30, 2017 13:44
Combining React and D3 by letting D3 manage the DOM
import { select } from 'd3-selection';
import * as React from 'react';
interface Props {
data: number[];
width: number;
height: number;
}
export default class BarChart extends React.Component<Props> {

Keybase proof

I hereby claim:

  • I am vsaarinen on github.
  • I am vsaarinen (https://keybase.io/vsaarinen) on keybase.
  • I have a public key ASC_Bnhv3V4kCXmN0GsgzJl_CkNjgMQnXlQjfqV5ky3ruwo

To claim this, I am signing this object:

@vsaarinen
vsaarinen / react-some-component.d.ts
Last active April 25, 2020 22:42
How to add TypeScript prop type definitions to an existing React component
import * as React from 'react';
declare class SomeReactComponent extends React.Component<SomeReactComponentProps, any> {}
interface SomeReactComponentProps {
className?: string;
toggle?: boolean;
name: string;
size?: 'lg' | '2x' | '3x' | '4x' | '5x';
}
@vsaarinen
vsaarinen / list-inactive-users.rb
Last active September 7, 2015 11:33
List inactive users in a Flowdock organization
#!/usr/bin/ruby
require 'rubygems'
require 'flowdock'
ORGANIZATION_DOMAIN = 'FLOWDOCK_DOMAIN'
client = Flowdock::Client.new(api_token: 'PERSONAL_API_TOKEN')
last_login_days_ago = 90 # select users whose last login time is at a minimum this many days ago
users = client.get("/organizations/#{ORGANIZATION_DOMAIN}/audits/users")
@vsaarinen
vsaarinen / remove-inactive-users.rb
Last active September 7, 2015 11:34
Remove inactive users from a Flowdock organization
#!/usr/bin/ruby
require 'rubygems'
require 'flowdock'
require 'highline/import'
ORGANIZATION_DOMAIN = 'FLOWDOCK_DOMAIN'
client = Flowdock::Client.new(api_token: 'PERSONAL_API_TOKEN')
last_login_days_ago = 90 # select users whose last login time is at a minimum this many days ago
@vsaarinen
vsaarinen / Deploying Sharetribe to Heroku.md
Last active September 2, 2015 07:59 — forked from svallory/Deploying Sharetribe to Heroku.md
Deploying Sharetribe to Heroku

Deploying to Heroku

  1. Deploy the app to heroku following heroku normal instructions (add link to heroku help)

  2. Set heroku environment variables

    Make sure all the options in config.yml are properly set then run:

     bundle exec rake heroku:config
    

Keybase proof

I hereby claim:

  • I am vsaarinen on github.
  • I am vsaarinen (https://keybase.io/vsaarinen) on keybase.
  • I have a public key whose fingerprint is 5ACD 31CA D262 A218 4516 700C 1960 9AAA 58B6 A4D5

To claim this, I am signing this object: