Skip to content

Instantly share code, notes, and snippets.

View 34r7h's full-sized avatar
💭
Networking

34r7h

💭
Networking
View GitHub Profile
@34r7h
34r7h / authenticate_user.rs
Created August 8, 2024 16:24
simple auth
// src/user_management/authenticate_user.rs
use serde_json::{self, Value, json};
use std::sync::Arc;
use tokio::sync::Mutex;
use redis::aio::MultiplexedConnection;
use redis::AsyncCommands;
use futures_util::future::{BoxFuture, FutureExt};
use sha2::{Sha256, Digest};
use chrono::Utc;

Keybase proof

I hereby claim:

  • I am 34r7h on github.
  • I am 34r7h (https://keybase.io/34r7h) on keybase.
  • I have a public key ASAOu_85kXZOkNgTBXvJlu5usiJpZ6yv8Ykp1Pdi6IfOvwo

To claim this, I am signing this object:

@34r7h
34r7h / codeblock.js
Created February 15, 2016 02:24
stamplay debugging for 500 error
module.exports = function(context, cb) {
var google = require('googleapis');
var request = require('request');
var baseUrl = 'https://www.googleapis.com/customsearch/v1';
console.log(baseUrl);
var query = context.data.query;
var auth = '?key='+context.data.key+'&cx='+context.data.cx;
var authQuery = auth+query;
@34r7h
34r7h / designer.html
Last active August 29, 2015 14:09
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../topeka-elements/topeka-datasource.html">
@34r7h
34r7h / app_app.js
Created November 9, 2014 23:54
problems with getting firebase data
'use strict';
angular.module('nuMetalApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ui.router',
'ui.bootstrap',
'firebase'
])
<p>Parent Article Array: {{ articles }}</p>
<div class="clearfix panel panel-default">
<div class="col-xs-3 panel-body" ng-repeat="article in product.articles track by $index" ng-init="$parent.articles[$index] = article" ng-click="showOptions = true">
<div ng-show="showOptions" ng-click="$parent.removeContentArticles($parent.product.articles, article);">Remove Article</div>
<p>url: {{$parent.api.show.articles.$getRecord(article).articleURL}}</p>
<div ng-if="($index+1) % 4 === 0" class="clearfix"></div>
</div>
</div>
<div class="panel panel-default clearfix">
@34r7h
34r7h / video.js
Created July 11, 2013 02:34 — forked from Drubo/video.js
var child_process = require('child_process'),
sys = require('sys'),
http = require('http'),
parse = require('url').parse,
fs = require('fs');
var spawn = child_process.spawn;
var exec = child_process.exec;