Skip to content

Instantly share code, notes, and snippets.

View SuperstrongBE's full-sized avatar
🏠
Working from home

RockerOne SuperstrongBE

🏠
Working from home
View GitHub Profile
@SuperstrongBE
SuperstrongBE / mediasUtils.directive.js
Last active August 29, 2015 14:17
Angular image parent cover directive
angular.module('MediasUtils',[])
/**
* @description An angular directive that resize media to cover his parent size.
*/
.directive('mediaCover',function (){
var linkFn
,layoutFn
;
/**
@SuperstrongBE
SuperstrongBE / media.directives.js
Last active August 29, 2015 14:17
Angular video
angular.module ('app.media')
directive('videoPlayer',function ($sce,$timeout,videoPlayerService){
var linkFn
,controllerFn
,templateStr
;
templateStr = '<video ng-src="{{src}}"></video><section ng-transclude></section>'
@SuperstrongBE
SuperstrongBE / modules.sh
Last active August 29, 2015 14:19
A simple Shell that scaffold an angular module folder
#!/bin/bash
verbose='false'
appName=''
moduleName='module'
while getopts 'a:v m:v' flag;
do
case ${flag} in
a) appName=${OPTARG}.;;
m) moduleName=${OPTARG};;
var mybApp = angular.module('ss.Constant',[])
.constant ('publicView',
[
'/app/login'
]
)
.constant('DB_CONFIG', {
name: 'mybDB_08'/*+Math.floor(Math.random()*10)*/,
tables: [
{
/*--------------------------------------
* Original Gist by dimdimbe : https://gist.github.com/dimdimbe/37abbe5b95bbee800dac94b1e6bba144
* After Further reading, it seem's that require break the singleton pattern.
* By the nature of the require cache system, the internal Instance of singleton is preserved... until Garbage collector is triggered.
* The most simple workaround is to "polute" the global scope to store the singleton internal instance,
* global variables are never disposed of by the GC.
/*--------------------------------------
var SocketInstance = null
;
@SuperstrongBE
SuperstrongBE / FaceHelpers.js
Created November 29, 2020 19:12
A threejs helper for faces, planar, center for faces selection, ...
import {Vector3} from 'three';
/**
*
* @param refFace {Face3D}
* @param faces {Array}
* @returns {Array}
*/
export function findPlanarFaces(refFace, faces) {
@SuperstrongBE
SuperstrongBE / atomicassets-postman.json
Last active May 5, 2022 15:19
Atomic asset postman collection
{
"info": {
"_postman_id": "c2fbc424-ef1f-40db-ac96-00e8ecf26137",
"name": "contracts",
"description": "### EOSIO Contract API\n*Made with ♥️ by [pink.gg](https://pink.gg/)*\n#### Current Chain: wax-testnet\n#### Provided by: [pink.network](https://pink.network)",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "atomicassets/v1",
import {
generateCreateAccountAction, //Just a function that return a prebuild action
generateBuyRamBytesAction, //Just a function that return a prebuild action
} from '../utils/proton/actions/EosActions';
import { ProtonRPC } from '../utils/proton/rpc/ProtonRPC';
export class EosService {
async isAccountExist(newAccountName: string): Promise<boolean> {
const rpc = new ProtonRPC();
const account = await rpc.getAccount(newAccountName);
@SuperstrongBE
SuperstrongBE / ProtonSDK.ts
Created June 16, 2022 10:55
A abstraction wrapper of the proton SDK with helpers function
import { Api, JsonRpc, RpcError, JsSignatureProvider } from '@proton/js';
import {
GetAccountResult,
GetTableRowsResult,
} from '@proton/js/dist/rpc/types';
export class ProtonRPC {
public rpc: JsonRpc;
public api: Api;
const { JsonRpc }= require("@eoscafe/light-api");
const rpc = new JsonRpc("proton");
/**
* Fetch token holder counts
* @returns {any}
*/
async getTokenHolders (){
return rpc.get_tokenholder_count('accountName','TOKEN');