Skip to content

Instantly share code, notes, and snippets.

View nmerouze's full-sized avatar

Nicolas Mérouze nmerouze

View GitHub Profile
class MyEditor {
onPaste = (_event, paste, state) => {
if (paste.type === "text" && isUrl(paste.text) && state.isCollapsed) {
return (
state
.transform()
.insertText(paste.text)
.extend(0 - paste.text.length)
.wrapInline({
type: "link",
defmodule Dd.Web.ConnCase do
use ExUnit.CaseTemplate
using do
quote do
use Phoenix.ConnTest
import Dd.Web.Router.Helpers
import Dd.Web.TestHelpers # Helpers added directly to ConnCase
@endpoint Dd.Web.Endpoint
@nmerouze
nmerouze / package.json
Created August 28, 2016 01:55
SASS with Webpack
{
"scripts": {
"start": "./node_modules/.bin/webpack-dev-server --content-base static"
},
"dependencies": {
"autoprefixer-loader": "^3.2.0",
"css-loader": "^0.24.0",
"extract-text-webpack-plugin": "^1.0.1",
"modularscale-sass": "^2.1.1",
"node-sass": "^3.8.0",
@nmerouze
nmerouze / .eslintrc
Last active February 16, 2017 20:56
.eslintrc
{
"parser": "babel-eslint",
/*"plugins": ["react"],*/
"ecmaFeatures": {
/*"jsx": true,*/
"modules": true
},
"env": {
"browser": true,
"node": true,
@nmerouze
nmerouze / main.go
Last active March 2, 2022 16:36
JSON-API with Go and MongoDB: Final Part
package main
import (
"encoding/json"
"log"
"net/http"
"reflect"
"time"
"github.com/gorilla/context"
@nmerouze
nmerouze / main.go
Created December 5, 2014 12:07
JSON-API with Go and MongoDB: Part 2
package main
import (
"encoding/json"
"log"
"net/http"
"reflect"
"time"
"github.com/gorilla/context"
@nmerouze
nmerouze / main.go
Created December 5, 2014 12:03
JSON-API with Go and MongoDB: Part 1
package main
import (
"encoding/json"
"log"
"net/http"
"reflect"
"time"
"github.com/gorilla/context"
@nmerouze
nmerouze / main.go
Last active May 6, 2021 16:40
Example for "Build Your Own Web Framework in Go" articles
package main
import (
"database/sql"
"encoding/json"
"errors"
"fmt"
"log"
"net/http"
"time"
# DESCRIPTION:
# A simple zsh configuration that gives you 90% of the useful features that I use everyday.
#
# AUTHOR:
# Geoffrey Grosenbach http://peepcode.com
############
# FUNCTIONS
############
gem "mongoid", ">= 2.0.0.beta9"
gem "bson_ext", ">= 1.0.3"
gem "haml", ">= 3.0.12"
gem "rspec-rails", ">= 2.0.0.beta.15", :group => :test
generators = <<-GENERATORS
config.generators do |g|
g.orm :mongoid
g.template_engine :haml
g.test_framework :rspec, :fixture => true, :views => false