Skip to content

Instantly share code, notes, and snippets.

/*so let's simplify you have
- your letters (all messages, yours & other peer) which you draw to DOM
- you have your outbox , when you say something, that the other person listens to with .on(...)
and adds to their letters when they arrive
- you listen with .on(...) the other peers messages and add them to letters when
they arrive
- on your send(){...} you would add the message to your letters
and to the outbox so your message can trigger the other persons .on */
class Chat {
@zilveer
zilveer / myHelper.js
Created December 15, 2019 16:46 — forked from jabis/gun.helper.js
Gun userspace get/set with encryption
/**
* get and put encrypted material to paths in Gun
* FIXME: Investigate why root level put doesn't work
* TODO: Add signing to make objects unwritable by others
**/
const decEnc = this.decEnc = async(...args)=> {
console.log(args);
let data = args.length > 0 ? args.shift() : false; // data as first argument
let pair = args.length > 0 ? args.shift() : false; // pair to use in decrypting/encrypting as second argument
@zilveer
zilveer / GunDBpermissionExample.js
Created August 22, 2019 12:02 — forked from ThinkingJoules/GunDBpermissionExample.js
GunDB group permissions example. Restrict reads and/or writes.
//CLIENT
Gun.on('opt', function (ctx) {
if (ctx.once) {
return
}
this.to.next(ctx)
ctx.on('auth', function(msg){
let to = this.to
clientAuth(ctx)
function clientAuth(ctx){
Node / Iquidus Explorer Setup for Dummies
Pulse Crypto is used in this example.
This Tutorial is going to create a Daemon (node) and install Explorer.
THIS IS NOT GOING TO CREATE A GUI CLIENT.
Follow the instructions in [whatever coin name] docs folder Unix build - some builds are different.
I setup this up on both Ubuntu 15.10 and 16.04 with no issues.
You can create an account on vultr and get $50 free to be used in 2 months.
@zilveer
zilveer / keystone_roles_permissions.md
Created October 6, 2017 23:11 — forked from webteckie/keystone_roles_permissions.md
Keystone Roles and Permissions

Keystone Roles & Permissions Support

The following documents the user permission support in keystone based on the support being added via PR #2111. Permissions are based on roles. If a user has a role and the list also specifies that role for any of its CRUD operations then it is permissive for the user to perform whichever CRUD operation matches the role. All users must define, at least, one role. The following are guidelines for adding role/permission support to your application:

Define a Role List Model:

@zilveer
zilveer / LocalStorage.js
Created September 15, 2017 07:17 — forked from anonymous/LocalStorage.js
LocalStorage JavaScript Module
/**
* Check if localStorage is supported const isSupported: boolean
* Check if localStorage has an Item function hasItem(key: string): boolean
* Get the amount of space left in localStorage function getRemainingSpace(): number
* Get the maximum amount of space in localStorage function getMaximumSpace(): number
* Get the used space in localStorage function getUsedSpace(): number
* Backup Assosiative Array interface Backup
* Get a Backup of localStorage function getBackup(): Backup
* Apply a Backup to localStorage function applyBackup(backup: Backup, fClear: boolean = true, fOverwriteExisting: boolean = true)
* Dump all information of localStorage in the console function consoleInfo(fShowMaximumSize: boolean = false)
@zilveer
zilveer / LocalStorage.js
Created September 15, 2017 07:17 — forked from picode7/LocalStorage.js
LocalStorage JavaScript Module
/**
* Check if localStorage is supported const isSupported: boolean
* Check if localStorage has an Item function hasItem(key: string): boolean
* Get the amount of space left in localStorage function getRemainingSpace(): number
* Get the maximum amount of space in localStorage function getMaximumSpace(): number
* Get the used space in localStorage function getUsedSpace(): number
* Backup Assosiative Array interface Backup
* Get a Backup of localStorage function getBackup(): Backup
* Apply a Backup to localStorage function applyBackup(backup: Backup, fClear: boolean = true, fOverwriteExisting: boolean = true)
* Dump all information of localStorage in the console function consoleInfo(fShowMaximumSize: boolean = false)
@zilveer
zilveer / HTML5.localStorage.js
Created September 15, 2017 07:16 — forked from chappy84/HTML5.localStorage.js
HTML5 Storage without the restrictions on storing objects
if (typeof HTML5 == 'undefined') {
var HTML5 = {};
}
/**
* Wrapper class to deal with easily storing values in local storage
* without having to constantly use JSON.parse and JSON.stringify everywhere
* you want to save an object.
*
* @param {String} index the base index to use in the localStorage global object
* @author Tom Chapman
@zilveer
zilveer / bind_connect.py
Created September 2, 2017 15:25 — forked from leonjza/bind_connect.py
Python Netcat Shell Connect
#!/usr/bin/python
host = "127.0.0.1"
port = 4444
# try and connect to a bind shell
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
@zilveer
zilveer / file0.txt
Created August 27, 2017 13:51 — forked from jhURJQVxkx/file0.txt
CentOS7にheroku toolbeltをインストール ref: http://qiita.com/kaishero/items/777323c4ec8f9fd425f9
$ sudo wget -qO- https://toolbelt.heroku.com/install.sh | sh
$ echo 'PATH="/usr/local/heroku/bin:$PATH"' >> .bash_profile
$ source .bash_profile
$ heroku version
$ heroku login
Enter your Heroku credentials.
Email: メールアドレス
Password (typing will be hidden): パスワード