Skip to content

Instantly share code, notes, and snippets.

View cmnstmntmn's full-sized avatar
🐕

Constantin Angheloiu cmnstmntmn

🐕
View GitHub Profile

VerneConfig

allow_anonymous = on
listener.ws.default = 127.0.0.1:8080
listener.ws.proxy_protocol = on

Nginx

> [email protected] build /Users/constantin/experiments/BoilerWebApp
> node scripts/build
{ Error
at Function.missingTransform (/Users/constantin/experiments/BoilerWebApp/node_modules/buble/dist/buble.cjs.js:376:9)
at Node.initialise (/Users/constantin/experiments/BoilerWebApp/node_modules/buble/dist/buble.cjs.js:3619:17)
at Node.initialise (/Users/constantin/experiments/BoilerWebApp/node_modules/buble/dist/buble.cjs.js:102:11)
at Node.initialise (/Users/constantin/experiments/BoilerWebApp/node_modules/buble/dist/buble.cjs.js:3446:9)
at value.forEach.node (/Users/constantin/experiments/BoilerWebApp/node_modules/buble/dist/buble.cjs.js:100:40)
at Array.forEach (<anonymous>)
<xsl:template select="people">
// -- return a list
<xsl:apply-templates select="entry" />
<xsl:template>
<xsl:template select="entry">
<xsl:value-of select="entry/id" /><xsl:if test="position() != last()">,</xsl:value-of>
</xsl:template>
<xsl:template name="form">
@cmnstmntmn
cmnstmntmn / .htaccess
Created October 22, 2018 11:49
htaccess
RewriteEngine on
RewriteCond %{REQUEST_URI} CUVANTUL_DIN_URL
RewriteRule ^ http://unde-vreau-sa-redirectez.com [L,R]
@cmnstmntmn
cmnstmntmn / api.js
Created August 15, 2018 21:30
m.request wrapper
// -- wrapper around m.request using #next branch
import m from 'mithril'
const api = {
request: (options) => {
options.config = xhr => {
xhr.setRequestHeader('Authorization', 'Bearer ' + api.token())
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest')
}
@cmnstmntmn
cmnstmntmn / app.js
Created August 7, 2018 11:20
MithrilJS base app with routes, auth and layout
var isLoggedIn = false;
m.route.prefix('')
//-- pages
var home = {
view: () => m('p', 'Home')
}
var some = {
package middlewares
import (
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
jwt "github.com/dgrijalva/jwt-go"
)
type JwtCustomClaims struct {
ID uint `json:"id"`
package middlewares
import (
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
)
func SetJwtMiddlewares(g *echo.Group) {
g.Use(middleware.JWTWithConfig(middleware.JWTConfig{
SigningMethod: "HS512",
func (u *User,) generateUserJwt(origin *UserLogged) (error, string) {
cfg := config.GetConfig()
// Set custom claims
claims := &JwtCustomClaims{
origin.ID,
origin.Role,
jwt.StandardClaims{
ExpiresAt: time.Now().Add(time.Hour * 72).Unix(),
},
@cmnstmntmn
cmnstmntmn / console.log
Last active July 16, 2018 06:48
verne-crdb
2018-07-16 09:40:06.756 [error] <0.409.0>@vmq_diversity_lager:error:36 a intrat aici
2018-07-16 09:40:06.758 [error] <0.409.0>@vmq_diversity_lager:error:36 all bad
2018-07-16 09:40:06.758 [warning] <0.491.0>@vmq_mqtt_fsm:check_user:555 can't authenticate client {[],<<"ctin">>} due to error