Skip to content

Instantly share code, notes, and snippets.

View pipethedev's full-sized avatar
🎯
Focusing

Ileri⚡️ pipethedev

🎯
Focusing
View GitHub Profile
@pipethedev
pipethedev / ts
Created July 1, 2023 11:22
search.ts
public async getRepos(installationId: number, { page, limit, q }: any, git: GIT_TYPE = GIT_TYPE.GITHUB) {
page = Number(page);
limit = Number(limit);
const deploymentProvider = DeploymentProvider.getProvider(git);
let data: any;
if (q) {
@pipethedev
pipethedev / encrypt.ts
Last active June 11, 2022 11:34
Node js laravel like encryption
import CryptoJS from "crypto-js";
class LaravelEncrypt{
public key: string;
constructor(key: string){
this.key = key;
}
public encrypt(data: string): string{
@pipethedev
pipethedev / index.ts
Last active April 10, 2022 22:45
Media upload with formdata
import axis from 'axios';
const formData = new FormData();
formData.append("assigned_page", "Room page");
formData.append("name", "Test Project");
formData.append("media", this.state.selectedFile);
async function upload(){
return await axios.post("<api_endpoint>", formData, {
headers: {
@pipethedev
pipethedev / content.html
Last active September 22, 2021 10:31
Editable
<!DOCTYPE html>
<html>
<head>
<title>Editable shit</title>
<style type="text/css">
#edit {background-color:#FFFF99;}
</style>
<script type="text/javascript">
function saveEdits() {
console.log('\n');
let bitcore = require('bitcore-lib');
let privateKeyWIF = 'cVumzeajS3k7QeUb8dcUiF5JH43uTLZUmZSYM87rRLbJvv4zJnX8';
let privateKey = bitcore.PrivateKey.fromWIF(privateKeyWIF);
let address = privateKey.toAddress();
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import SignIn from '../views/SignIn.vue'
import Dashboard from '../views/Dashboard.vue'
import store from '@/store'
Vue.use(VueRouter)
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import SignIn from '../views/SignIn.vue'
import Dashboard from '../views/Dashboard.vue'
import store from '@/store'
Vue.use(VueRouter)
<template>
<ul>
<li>
{{ user }}
<router-link :to="{name:'home'}">Home</router-link>
</li>
<template v-if="authenticated">
<li>
<router-link :to="{name:'signin'}">Sign In</router-link>
import store from '@/store'
import axios from 'axios'
store.subscribe((mutation) => {
switch(mutation.type){
case 'auth/SET_TOKEN':
if(mutation.payload){
axios.defaults.headers.common['Authorization'] = `Bearer ${mutation.payload}`
localStorage.setItem('token', mutation.payload)
}else{
import axios from 'axios'
export default{
namespaced: true,
state: {
token: null,
user : null
},
getters:{