Skip to content

Instantly share code, notes, and snippets.

View rohitkhatri's full-sized avatar

Rohit Khatri rohitkhatri

View GitHub Profile
@rohitkhatri
rohitkhatri / MigrateSpecificCommand.php
Last active December 12, 2022 23:10
Migrate specific migrations with this command
<?php
/* Instructions:
* 1. Add this class file to your app/Console folder
* 2. Register command in app/Console/Kernel by adding `\App\Console\Commands\MigrateSpecificCommand::class` it to commands array
* 3. Done, now you can access it like: php artisan migrate:specific 2014_10_12_000000_create_users_table,2014_10_12_100000_create_password_resets_table
*/
namespace App\Console\Commands;
const { TransactionHandler } = require('sawtooth-sdk/processor/handler');
const { InvalidTransaction } = require('sawtooth-sdk/processor/exceptions');
const { TextEncoder, TextDecoder } = require('text-encoding/lib/encoding');
const crypto = require('crypto');
const encoder = new TextEncoder('utf8');
const decoder = new TextDecoder('utf8');
const TP_FAMILY = 'grocery';
const TP_NAMESPACE = _hash(TP_FAMILY).substring(0, 6);
echo "This is a testing geist."
testVar="This is a testing message"
@rohitkhatri
rohitkhatri / jquery.tmpl.min.js
Created November 10, 2017 16:18
Index added when array passed to tmpl
(function(a){var r=a.fn.domManip,d="_tmplitem",q=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,b={},f={},e,p={key:0,data:{}},i=0,c=0,l=[];function g(g,d,h,e){var c={data:e||(e===0||e===false)?e:d?d.data:{},_wrap:d?d._wrap:null,tmpl:null,parent:d||null,nodes:[],calls:u,nest:w,wrap:x,html:v,update:t};g&&a.extend(c,g,{nodes:[],parent:d});if(h){c.tmpl=h;c._ctnt=c._ctnt||c.tmpl(a,c);c.key=++i;(l.length?f:b)[i]=c}return c}a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(f,d){a.fn[f]=function(n){var g=[],i=a(n),k,h,m,l,j=this.length===1&&this[0].parentNode;e=b||{};if(j&&j.nodeType===11&&j.childNodes.length===1&&i.length===1){i[d](this[0]);g=this}else{for(h=0,m=i.length;h<m;h++){c=h;k=(h>0?this.clone(true):this).get();a(i[h])[d](k);g=g.concat(k)}c=0;g=this.pushStack(g,f,i.selector)}l=e;e=null;a.tmpl.complete(l);return g}});a.fn.extend({tmpl:function(d,c,b){return a.tmpl(this[0],d,c,b)},tmplItem:function(){return a.tmplItem(this[0])},template:function(b){re