Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeremy Laviole poqudrof

  • CATIE
  • Bordeaux
View GitHub Profile
@CodyReichert
CodyReichert / react-es6-flow-emacs-configuration.md
Last active Jan 7, 2021
Configuring Emacs for react, es6, and flow
View react-es6-flow-emacs-configuration.md

Configuring Emacs for react, es6, and flow

For a while, JSX and new es6 syntax had flaky support in emacs, but there's been huge work on a lot of packages. Using emacs for JavaScript with React, ES6, and Flow (or Typescript, etc) is really easy and powerful in Emacs these days.

This is how you can work on modern web development projects with full support for tooling like JSX, Flow types, live eslint errors, automatic prettier.js formatting, and more.

Set up web-mode

web-mode provides most of the underlying functionality, so a huge shout-out to the maintainer(s) there.

@andyyou
andyyou / rails_webpacker_bootstrap_expose_jquery.md
Last active Sep 26, 2020
Rails 5.2 with webpacker, bootstrap, stimulus starter
View rails_webpacker_bootstrap_expose_jquery.md

Rails 5.2 with webpacker, bootstrap, stimulus starter

This gist will collects all issues we solved with Rails 5.2 and Webpacker

Create Project

# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
@amimaro
amimaro / UnityHttpListener.cs
Last active Dec 25, 2020
Listen for Http Requests with Unity
View UnityHttpListener.cs
using UnityEngine;
using UnityEngine.Networking;
using System;
using System.IO;
using System.Net;
using System.Threading;
public class UnityHttpListener : MonoBehaviour
{
View git-badges.html
<html>
<head>
<style>
div.badge {
display: inline-block;
border-radius: .75em;
font-family: 'Dejavu Sans','Arial';
}
div.badge div {
display: inline-block;
@timothypage
timothypage / Gemfile
Last active Jul 8, 2020
Quick hack to passthrough sinatra to webpack-dev-server for awesome client hot reloading plus live api endpoints
View Gemfile
source "https://rubygems.org"
gem "rack-proxy"
gem "sidekiq"
gem "sinatra"
gem "sinatra-contrib"
gem "py"
@zulhfreelancer
zulhfreelancer / heroku_pg_db_reset.md
Last active Jan 27, 2021
How to reset PG Database on Heroku?
View heroku_pg_db_reset.md

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

heroku restart; heroku pg:reset DATABASE --confirm APP-NAME; heroku run rake db:migrate

@rkh
rkh / chat.rb
Created Dec 14, 2011
Simple Chat Application using the Sinatra Streaming API
View chat.rb
# coding: utf-8
require 'sinatra'
set server: 'thin', connections: []
get '/' do
halt erb(:login) unless params[:user]
erb :chat, locals: { user: params[:user].gsub(/\W/, '') }
end
get '/stream', provides: 'text/event-stream' do
@czj
czj / gist:1251031
Created Sep 29, 2011
.irbrc that runs Pry instead of IRB
View gist:1251031
# This script comes from Pry Everywhere by Luca Pette
# http://lucapette.com/pry/pry-everywhere/
# https://github.com/carlhuda/bundler/issues/183#issuecomment-1149953
if defined?(::Bundler)
global_gemset = ENV['GEM_PATH'].split(':').grep(/ruby.*@global/).first
if global_gemset
all_global_gem_paths = Dir.glob("#{global_gemset}/gems/*")
all_global_gem_paths.each do |p|
gem_path = "#{p}/lib"