Skip to content

Instantly share code, notes, and snippets.

View slopeofhope81's full-sized avatar

Steve Lim slopeofhope81

View GitHub Profile
@slopeofhope81
slopeofhope81 / README.md
Created February 5, 2018 21:32
Sequelize + Express + Migrations + Seed Starter
# This tells kubecfg to read its config from the local directory
export KUBECONFIG=./kubeconfig
# Looking at the cluster
kubectl get nodes
kubectl get pods --namespace=kube-system
# Running a single pod
kubectl run --generator=run-pod/v1 --image=gcr.io/kuar-demo/kuard-amd64:1 kuard
kubectl get pods
@slopeofhope81
slopeofhope81 / userAvatar.js
Created March 8, 2018 21:52 — forked from SylarRuby/userAvatar.js
NodeJs AWS S3 Upload
/**
* This gist was inspired from https://gist.github.com/homam/8646090 which I wanted to work when uploading an image from
* a base64 string.
* This code is used in my startup, Zired.
* Web: http://zired.io
*/
// You can either "yarn add aws-sdk" or "npm i aws-sdk"
const AWS = require('aws-sdk')
@slopeofhope81
slopeofhope81 / package.json
Last active May 11, 2018 23:46 — forked from coryhouse/package.json
package.json
{
"name": "application",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"dev": "nodemon server.js",
"build": "webpack",
"start": "node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --port 8000",
"test": "jest",
//require("babel-register");
//module.exports = require("./webpack.config.babel");
import webpack from "webpack";
import path from 'path';
import CleanWebpackPlugin from 'clean-webpack-plugin';
import HtmlWebpackPlugin from "html-webpack-plugin";
@slopeofhope81
slopeofhope81 / .eslintrc.json
Created March 21, 2018 09:59 — forked from coryhouse/.eslintrc.json
.eslintrc.json file for "Building a JavaScript Development" Pluralsight course
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module"
import React, { Component } from 'react';
import { reduxForm, Field } from 'redux-form';
class Signin extends Component {
onSubmit({ email, password }) {
console.log(email);
console.log(password);
}
renderField(field) {
@slopeofhope81
slopeofhope81 / adapter.py
Created December 12, 2018 21:29 — forked from pazdera/adapter.py
Example of `adapter' design pattern in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example of `adapter' design pattern
# Copyright (C) 2011 Radek Pazdera
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@slopeofhope81
slopeofhope81 / FixCommandForMacKeyboard.md
Created December 12, 2019 12:52 — forked from digiter/FixCommandForMacKeyboard.md
Map Command Key to Control For ubuntu + mac keyboard

For each machine running xmodmap will give you the mapping and keycode, take a look first then write the script. I use ubuntu and mac keyboard. The below maps both left and right control and super.

Create an .Xmodmap file in your Linux home directory, with the following contents, then execute xmodmap .Xmodmap

clear control
clear mod4

keycode 37 = Super_L
keycode 105 = Super_R
# Call scopes directly from your URL params:
#
# @products = Product.filter(params.slice(:status, :location, :starts_with))
module Filterable
extend ActiveSupport::Concern
module ClassMethods
# Call the class methods with names based on the keys in <tt>filtering_params</tt>
# with their associated values. For example, "{ status: 'delayed' }" would call