Skip to content

Instantly share code, notes, and snippets.

@PikachuEXE
PikachuEXE / babel_loader_builder.js
Created March 18, 2019 08:02
Webpacker 4 multiple target config
/* eslint-disable global-require */
/* eslint-env node */
const validEnv = ["development", "test", "production"]
const currentEnv = process.env.NODE_ENV || "unknown"
const isDevelopmentEnv = currentEnv === "development"
const isProductionEnv = currentEnv === "production"
const isTestEnv = currentEnv === "test"
if (!validEnv.includes(currentEnv)) {
@rabbitt
rabbitt / schema_clone.py
Last active October 8, 2020 12:56
PostgreSQL schema cloner (including data).
import psycopg2 as pg
from io import BytesIO
from collections import defaultdict
from contextlib import contextmanager
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT, ISOLATION_LEVEL_READ_COMMITTED
READ_COMMIT = ISOLATION_LEVEL_READ_COMMITTED
AUTO_COMMIT = ISOLATION_LEVEL_AUTOCOMMIT
@rye
rye / vomit.ru
Last active January 30, 2017 11:38
A Ruby web server to act like Python's SimpleHTTPServer module.
#!/usr/bin/env rackup
#\ -E deployment
use Rack::ContentLength
app = Rack::Directory.new Dir.pwd
run app
@diniremix
diniremix / dockersetup.MD
Last active September 22, 2016 14:16
setup docker on elementary OS freya

instalar docker

instalar una imagen (ubuntu 14.04 en este caso)

  • sudo docker run ubuntu:14.04

revisar las imagenes instaladas

  • sudo docker images

entrar en la imagen recien creada

@enricostano
enricostano / shift_register.rs
Last active May 13, 2016 14:01
Playing with shift registers with Rust + ARMv7 + GPIO
extern crate sysfs_gpio;
use sysfs_gpio::{Direction,Pin};
use std::time::Duration;
use std::thread::sleep;
fn main() {
let data_pin = Pin::new(18); // SER #14
let latch_pin = Pin::new(23); // RCLK #12
let clock_pin = Pin::new(24); // SRCLK #11