Skip to content

Instantly share code, notes, and snippets.

View poqudrof's full-sized avatar

Jeremy Laviole poqudrof

View GitHub Profile
@CodyReichert
CodyReichert / react-es6-flow-emacs-configuration.md
Last active September 26, 2023 05:56
Configuring Emacs for react, es6, and flow

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 August 9, 2022 07:38
Rails 5.2 with webpacker, bootstrap, stimulus starter

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 December 18, 2023 12:31
Listen for Http Requests with Unity
using UnityEngine;
using UnityEngine.Networking;
using System;
using System.IO;
using System.Net;
using System.Threading;
public class UnityHttpListener : MonoBehaviour
{
@amboutwe
amboutwe / yoast_seo_breadcrumb_add_woo_shop.php
Last active March 15, 2024 14:55
Multiple examples of how to customize the Yoast SEO breadcrumbs
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/*
* Add shop link to the Yoast SEO breadcrumbs for a WooCommerce shop page.
* Credit: https://wordpress.stackexchange.com/users/8495/rjb
* Last Tested: Apr 20 2017 using Yoast SEO 4.6 on WordPress 4.7.3
*/
add_filter( 'wpseo_breadcrumb_links', 'wpseo_breadcrumb_add_woo_shop_link' );
@soundstorm
soundstorm / git-badges.html
Created February 6, 2017 13:29
Pure CSS Git-Badges
<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 December 25, 2021 10:36
Quick hack to passthrough sinatra to webpack-dev-server for awesome client hot reloading plus live api endpoints
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 January 29, 2024 10:09
How to reset PG Database on Heroku (for Rails app)?

It's important to note that running this reset will drop any existing data you have in the application

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

@rkh
rkh / chat.rb
Created December 14, 2011 12:55
Simple Chat Application using the Sinatra Streaming API
# 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 September 29, 2011 15:43
.irbrc that runs Pry instead of IRB
# 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"