Skip to content

Instantly share code, notes, and snippets.

View HintikkaKimmo's full-sized avatar

Kimmo Hintikka HintikkaKimmo

View GitHub Profile
@knorwood
knorwood / send_to_batch.py
Created September 5, 2018 01:30
Sending data to Amplitude's Batch Endpoint
"""
Sending a payload of events to the /batch endpoint using the requests library.
"""
import json
import requests
# Be cautious when setting your API key and running this script since it will send the following
# two events to your app!
API_KEY = 'YOUR_API_KEY_HERE'
EVENTS = [
@nijicha
nijicha / install_nodejs_and_yarn_homebrew.md
Last active January 30, 2024 12:14
Install NVM, Node.js, Yarn via Homebrew
@gabeweaver
gabeweaver / react-cognito-auth-js.js
Last active January 20, 2024 15:03
React + Cognito User Pools + Cognito Identity JS Example
/*
This example was built using standard create-react-app out of the box with no modifications or ejections
to the underlying scripts.
In this example, i'm using Google as a social provider configured within the Cognito User Pool.
Each step also represents a file, so you can see how I've chosen to organize stuff...you can do it however
you'd like so long as you follow the basic flow (which may or may not be the official way....but its what I found that works.
The docs are pretty horrible)
@genomics-geek
genomics-geek / README.md
Last active September 9, 2021 23:11
Setup ReactJS, Redux, Webpack with React Hot Reloading on an existing Django Project

Setting up ReactJS/Redux using Webpack for an existing Django project

This guide will help set up your django project to use ReactJS

1. Install Python dependencies

Add pip requirements to our django project:

  • django-webpack-loader==0.4.1 ( Connects Django project with Webpack)
@pcm211
pcm211 / Deploying on Amazon AWS (Free-Tier) with EC2, RDS & S3.md
Last active August 12, 2023 21:09
This Is a step by step way to deploy Sharetribe to Amazon AWS Free Tier in Development Mode (Not Production)

Prerequisites

  1. Have an AWS Account
  2. Spin up an EC2 Instance of Ubuntu Server and Make sure that your instance's security groups allow incoming connections on TCP ports 22 and 3000
  3. Use an Elastic IP to bind your Instance to it --- You would not be paying for this -- Till the time the EC2 Instance is running
  4. Add the IP Allocated to your A Record --- with your registrar
  5. Have a SSH Connection to your EC2 Instance with the Key Pairs
  6. Connect to the EC2 Instance

STEP 1 -- Setting up the Playground

@alexpchin
alexpchin / Rails_Generating_and_Scaffolding.md
Last active April 2, 2024 12:24
Rails Generating & Scaffolding

Rails Generating & Scaffolding

Rails' use of strict naming conventions means a lot of core code SHOULD be in the same format whoever writes it? It could be written by a friend, colleague or a computer... it shouldn't matter because the same Rails rules apply to everyone.

This means that Rails can actually do some tasks for you! It can actually build things and write code on your behalf...

Coming from another language like PHP, this can seem like magic.

@mattseymour
mattseymour / django-secret-keygen.py
Last active September 8, 2022 23:47
Django secret key generator
"""
Pseudo-random django secret key generator.
- Does print SECRET key to terminal which can be seen as unsafe.
"""
import string
import random
from __future__ import print_function
@gnomet
gnomet / Sharetribe DB installation
Created January 31, 2011 16:32
Running these commands in MySQL will create three databases where the user "sharetribe" has access. DON'T FORGET TO CHANGE ALL THE put_a_password_here PARTS TO A SECURE PASSWORD!
CREATE DATABASE sharetribe_test CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE sharetribe_development CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE sharetribe_production CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT all privileges ON sharetribe_development.* TO 'sharetribe'@'localhost' IDENTIFIED BY 'put_a_password_here';
GRANT all privileges ON sharetribe_production.* TO 'sharetribe'@'localhost' IDENTIFIED BY 'put_a_password_here';
GRANT all privileges ON sharetribe_test.* TO 'sharetribe'@'localhost' IDENTIFIED BY 'put_a_password_here';