Skip to content

Instantly share code, notes, and snippets.

View xpepermint's full-sized avatar
💭
Developing the future

Kristijan Sedlak xpepermint

💭
Developing the future
View GitHub Profile
@ilake
ilake / sorcery_async_email.rb
Created January 27, 2012 05:04
Async Emails With Sorcery by delayed_job
#config/initializers/sorcery_async_email.rb
module Sorcery
module InstanceMethods
def generic_send_email(method, mailer)
config = sorcery_config
config.send(mailer).delay.send(config.send(method),self)
end
end
end
end
@xpepermint
xpepermint / webpack.config.js
Last active April 20, 2021 07:04
Webpack Common Configuration File (ReactJS)
'use strict';
/**
* Webpack Configuration File
*
* This is a configuration file for Webpack module bundler. You should customize
* it to fit your project.
*
* To start the development server run:
*
@fbaiodias
fbaiodias / README.md
Last active July 21, 2021 19:04
GraphQL circular dependencies

Circular dependencies on GraphQL schemas

Problem

Whenever I uncomment the lines on author.js I get the following error:

/Users/xicombd/Code/taskq/taskq-api/node_modules/graphql/jsutils/invariant.js:20
    throw new Error(message);
    ^
@xpepermint
xpepermint / webpack.config.js
Last active October 27, 2022 06:12
Vue.js webpack.config.js
var path = require('path');
var webpack = require('webpack');
var isProduction = process.env.NODE_ENV === 'production';
/*
* Compile for usage in a browser-like environmen or for the server.
*/
exports.target = 'web';
@xpepermint
xpepermint / pre-post
Last active November 28, 2016 09:10
git `.git/hooks/pre-post` to commite bundles into `production` branch
```
#!/bin/sh
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
if [ "master" != "$branch" ]; then
exit;
fi
git checkout production
@xpepermint
xpepermint / index.js
Created September 30, 2017 16:47
Using RawModel in ExpressJS actions.
const { Model } = require("rawmodel");
const express = require("express");
/** Application context *******************************************************/
class Context {
constructor() {
this.db; // imaginary database
}
connect() {
@xpepermint
xpepermint / README.md
Last active November 14, 2022 19:48
RushJS cheatsheet

Commands

Install dependencies:

npm install -g @microsoft/rush

Initialize the project:

@xpepermint
xpepermint / xcert-certification-example-for-ethereum.js
Last active October 10, 2021 17:16
0xcert.org certification
const { Cert } = require('@0xcert/cert');
const { HttpProvider } = require('@0xcert/ethereum-http-provider');
const { AssetLedger } = require('@0xcert/ethereum-asset-ledger');
(async () => {
const schema = {
"$schema": "http://json-schema.org/draft-07/schema",
"description": "A digital assets that have a unique combination of different properties.",
"properties": {
@Phaiax
Phaiax / how-does-async-work-in-async-std.md
Last active July 17, 2023 10:56
Blog article: How does async work in async-std?

How does async work in async-std?

(Phaiax - 2019/12/1 - CC_BY_SA 4.0)

Lately I was porting a software from tokio/futures-1.0 to async-await. I somehow thought async-std was the successor of tokio and ported everything to async-std. 80% in, I noticed that my hyper dependency requires tokio and that it's not possible to replace tokio with async-std without also replacing hyper. Also, tokio and async-std try to solve the same problem. So I started a journey into the inners of the rust async story to find out if it is possible to use both tokio and async-std at the same time. (tl;dr: it is). I had heard of reactors and executors before, but there was much new stuff to discover.

@jbr
jbr / cargo.toml
Created April 24, 2020 05:10
surf-tide-proxy-example
[package]
name = "surf-tide-proxy-example"
version = "0.1.0"
authors = ["Jacob Rothstein <[email protected]>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
surf = { git = "https://github.com/http-rs/surf", branch = "master" }