Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
住まいは川沿い

Agano oasis kenseii

:octocat:
住まいは川沿い
View GitHub Profile
View goofys.bash
# Install go
$ sudo apt-get install golang-go
# Download goofys package
$ go get github.com/kahing/goofys
# Install goofys
$ go install github.com/kahing/goofys
# Copy the goofys binary to somewhere in your path
@kenseii
kenseii / Guardian JWT.md
Created Jun 17, 2020 — forked from nikneroz/Guardian JWT.md
Elixir + Phoenix Framework + Guardian + JWT. This is tutorial and step by step installation guide.
View Guardian JWT.md

Elixir + Phoenix Framework + Guardian + JWT + Comeonin

Preparing environment

We need to generate secret key for development environment.

mix phoenix.gen.secret
# ednkXywWll1d2svDEpbA39R5kfkc9l96j0+u7A8MgKM+pbwbeDsuYB8MP2WUW1hf

Let's generate User model and controller.

@kenseii
kenseii / feedback.py
Last active Jul 18, 2019
basic feedback aggregator using rpi
View feedback.py
# import libraries and basic configs
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library
GPIO.setwarnings(False) # Ignore warning for now
GPIO.setmode(GPIO.BOARD) # Use physical pin numbering
from influxdb import InfluxDBClient
import time
client = InfluxDBClient('localhost', 8086, 'root', 'root', 'customer_servicedb') # c$
# set good and bad pin
View .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/oasis/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
View Elixir Videos
# Basic Syntax
Introduction to Elixir https://www.youtube.com/watch?v=DltjeuB4Cu0
# Intermediate Syntax
Tutoriel Elixir : Découverte du langage Elixir https://www.youtube.com/watch?v=1hl_z9-QO9c
# Basics of OTP
The ABCs of OTP - Jesse J. Anderson https://www.youtube.com/watch?v=4SCwubzqsVU
@kenseii
kenseii / .zshrc
Last active Oct 10, 2019
ubuntu .zshrc config
View .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/oasis/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@kenseii
kenseii / jupyter_shortcuts.md
Created Mar 28, 2019 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter
View jupyter_shortcuts.md

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

MacOS modifier keys:

  • ⌘ : Command
@kenseii
kenseii / counter.exs
Created Mar 24, 2019
Elixir counting w,l,c
View counter.exs
filename =
IO.gets("File to count the words from (h for help):\n")
|> String.trim
if filename == "h" do
IO.puts """
Usage: [filename] -[flags]
Flags
-l displays line count
-c displays character count
@kenseii
kenseii / bitcoinRPC.py
Created Nov 6, 2017 — forked from ptabatt/bitcoinRPC.py
This is the backend for a Bitcoin RPC Plugin for the Web2py Framework
View bitcoinRPC.py
#!/usr/bin/env python
# coding: utf8
from gluon import *
from jsonrpc import ServiceProxy
import re
#access is a Server Proxy object between web2py and the command
#line program bitcoind using the session variables you supplied
#in the index page
@kenseii
kenseii / Readme.md
Created Sep 17, 2017 — forked from pdvyas/Readme.md
Sales Invoice REST API example
View Readme.md

This example uses curl. You can use any other means of making http requests. Responses are in JSON format.

  • Login to frappe (and store cookies in a jar)
% curl https://demo.frappecloud.com/api/method/login -XPOST \-d "usr=demo%40frappecloud.com&pwd=demo" -c frappe.cookie   
{"message":"Logged In","full_name":"Demo User"}
  • Request for a Sales Invoice by id (output is piped to json pretty printer(optional))