Skip to content

Instantly share code, notes, and snippets.

View iheanyi's full-sized avatar
🪐
Working on databases @planetscale

Iheanyi Ekechukwu iheanyi

🪐
Working on databases @planetscale
View GitHub Profile
@felicianotech
felicianotech / newer-go-on-circle-example.txt
Created November 14, 2016 21:52
An example of how to use Go versions newer than v1.6.2 on CircleCI.
machine:
environment:
GODIST: "go1.7.3.linux-amd64.tar.gz"
post:
- mkdir -p downloads
- test -e download/$GODIST || curl -o download/$GODIST https://storage.googleapis.com/golang/$GODIST
- sudo rm -rf /usr/local/go
- sudo tar -C /usr/local -xzf download/$GODIST
@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@gaearon
gaearon / Marble.js
Last active February 14, 2019 06:54
Marble-style sequencer + sampler for https://github.com/FormidableLabs/react-music
/*
This replaces <Sequencer> + multiple <Sampler>s with a marble diagram sequencer.
You can use it like this:
<Marble
resolution={16}
samples={[
'samples/kick.wav',
'samples/snare.wav',
]}

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@ehernandez-xk
ehernandez-xk / upload-file-s3.go
Last active January 31, 2021 00:56
Uploading a file to AWS S3 using aws-sdk-go
/*
https://www.youtube.com/watch?v=iOGIKG3EptI
https://github.com/awslabs/aws-go-wordfreq-sample/blob/master/cmd/uploads3/main.go
https://docs.aws.amazon.com/sdk-for-go/api/aws/
- first configure your aws credentials run: aws configure
- go get -u github.com/aws/aws-sdk-go/aws
- login to UI web aws s3 interface
- go to S3 service
@bcardarella
bcardarella / fastboot-deplo.md
Created July 3, 2016 22:54
How to deploy an ember fastboot app

App Setup

  1. ssh into server
  2. git clone the repo
  3. Configure {nginx,apache,etc} to forward requests to the fastboot server
  4. Configure {nginx,apache,etc} to fallback to static assets if fastboot is not available

App updates

  1. ssh into server
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@sogko
sogko / main.go
Last active May 28, 2024 00:29
Example of creating custom `graphql-go/handler` using `handler.NewRequestOptions()` to parse http.Requests
package main
import (
"encoding/json"
"net/http"
"github.com/graphql-go/graphql"
"github.com/graphql-go/handler"
"github.com/graphql-go/relay/examples/starwars"
)
<MatchMedia queries={{ mobile, tablet }}>
{media => (
media.mobile ? (
<div>mobile</div>
) : media.tablet ? (
<div>tablet</div>
) : (
<div>desktop</div>
)
)}
@mjackson
mjackson / WindowScrollTo.js
Last active January 16, 2017 02:11
Make window.scrollTo declarative using a <WindowScrollTo> React component
import React from 'react'
import warning from 'warning'
const { number, object } = React.PropTypes
const WindowScrollTo = React.createClass({
contextTypes: {
windowScrollTo: object
},