Skip to content

Instantly share code, notes, and snippets.

View kenseii's full-sized avatar
🕸️
Downloading RAM

Agano oasis kenseii

🕸️
Downloading RAM
View GitHub Profile
@kenseii
kenseii / counter.exs
Created March 24, 2019 03:03
Elixir counting w,l,c
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 November 6, 2017 17:37 — forked from ptabatt/bitcoinRPC.py
This is the backend for a Bitcoin RPC Plugin for the Web2py Framework
#!/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 September 17, 2017 09:53 — forked from pdvyas/Readme.md
Sales Invoice REST API example

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))
@kenseii
kenseii / Hot Reload JQUERY
Created August 9, 2017 21:19
use a div and a .get with jquery to get your data from another page on your website.
$(function() {
startRefresh();
});
function startRefresh() {
setTimeout(startRefresh,1000);
$.get('pagelink.php', function(data) {
$('#content_div_id').html(data);
});
}
@kenseii
kenseii / check_docker_container.sh
Created June 6, 2017 10:28 — forked from haukurk/check_docker_container.sh
Monitoring scripts for docker containers.
#!/bin/bash
# Author: Haukur Kristinsson / Erik Kristensen
# Email: haukur@hauxi.is / erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# The script checks if a container is running.
# OK - running