Skip to content

Instantly share code, notes, and snippets.

Constantin Angheloiu cmnstmntmn

Block or report user

Report or block cmnstmntmn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View err
> boiler_webapp@0.2.0 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>)
View users-to-send-notifications.xsl
<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">
View .htaccess
RewriteEngine on
RewriteCond %{REQUEST_URI} CUVANTUL_DIN_URL
RewriteRule ^ http://unde-vreau-sa-redirectez.com [L,R]
@cmnstmntmn
cmnstmntmn / api.js
Created Aug 15, 2018
m.request wrapper
View api.js
// -- 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 Aug 7, 2018
MithrilJS base app with routes, auth and layout
View app.js
var isLoggedIn = false;
m.route.prefix('')
//-- pages
var home = {
view: () => m('p', 'Home')
}
var some = {
View jwt.go
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"`
View jwt.go
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",
View fn.go
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(),
},
View console.log
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
View brunch-config.js
exports.config = {
// See http://brunch.io/#documentation for docs.
files: {
javascripts: {
joinTo: {
"js/app.js": 'js/app.js',
"js/rating.js": 'js/rating.js'
}
},
stylesheets: {
You can’t perform that action at this time.