Skip to content

Instantly share code, notes, and snippets.

View leoromanovsky's full-sized avatar

Leo Romanovsky leoromanovsky

View GitHub Profile
@LeZuse
LeZuse / 00_README.md
Last active April 22, 2024 15:06
Install node on Apple Silicon M1 both ARM and x86 (Rosetta)

Node.js on Apple Silicon

Node Version Manager (https://github.com/nvm-sh/nvm) works perfectly across native node installations as well as emulated Rosetta installations. The trick I am using here is to install one LTS version of node under Rosetta and another stable version as native binary.

TODO

  • find a way how to run the same node version on both platforms
@rayh
rayh / example.js
Created October 8, 2015 00:44
Spawn binary from AWS Lambda
var fs = require('fs');
var Q = require('q');
var spawn = require('child_process').spawn;
var path = require('path');
// Make sure you append the path with the lambda deployment path, so you can
// execute your own binaries in, say, bin/
process.env["PATH"] = process.env["PATH"] + ":" + process.env["LAMBDA_TASK_ROOT"] + '/bin/';
function spawnCmd(cmd, args, opts) {
@chriskjaer
chriskjaer / gulpfile.js
Last active November 1, 2017 08:22
Gulp recipe: Jade, Sass, Livereload and static server
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
csso = require('gulp-csso'),
uglify = require('gulp-uglify'),
jade = require('gulp-jade'),
concat = require('gulp-concat'),
livereload = require('gulp-livereload'), // Livereload plugin needed: https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei
tinylr = require('tiny-lr'),
express = require('express'),
@keit
keit / gist:6288233
Last active February 22, 2018 15:01
Rails4 + Bower + Bootstrap set-up
This document is outdated.
You should read David Bryant Copeland's excellent online book: http://angular-rails.com/crud_recipe.html
---------------------------------------------------------------------------------------------------------------
I think it's better to install javascript/css libraries using Bower rather than gem which is Ruby packager.
1. Install Rails 4 and create a new project.
2. Install bower(Note you need to install node first.)
sudo npm install -g bower
@thom4parisot
thom4parisot / Gruntfile.js
Last active December 20, 2015 11:49
Chrome Extension Channel Example
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
manifest: grunt.file.readJSON('src/manifest.json'),
zip: {
extension: {
cwd: 'src/',
src: [
@vparihar01
vparihar01 / nokogiri_libxml_homebrew_lion_installation.sh
Created June 25, 2013 07:01
How to fix: Nokogiri Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib provides version 10.0.0. dlopen bundle.open. Using homebrew on lion to install nokogiri and lixml
FIXME:
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
or
ERROR -: Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib provides version 10.0.0
gem uninstall nokogiri libxml-ruby
brew update
brew uninstall libxml2
@jphenow
jphenow / deploy.rake
Last active December 18, 2015 00:09 — forked from njvitto/deploy.rake
#Deploy and rollback on Heroku in staging and production
%w[staging production].each do |app|
desc "Deploy to #{app}"
task "deploy:#{app}" => %W[deploy:set_#{app}_app deploy:push deploy:restart deploy:tag]
desc "Deploy #{app} with migrations"
task "deploy:#{app}:migrations" => %W[deploy:set_#{app}_app deploy:push deploy:off deploy:migrate deploy:restart deploy:on deploy:tag]
desc "Rollback staging"
@semipermeable
semipermeable / tddium_post_build.rake
Last active October 4, 2015 12:48
Tddium post-build task to deploy into Heroku
def cmd(c)
system c
end
namespace :tddium do
desc "post_build_hook"
task :post_build_hook do
# This build hook should only run after CI builds.
#
# There are other cases where we'd want to run something after every build,
@danneu
danneu / anemone.rb
Created April 24, 2012 02:58
Crawls http://isbullsh.it and stores each blog post title & tag into MongoDB. RE: http://news.ycombinator.com/item?id=3878605
require 'anemone'
require 'mongo'
# Patterns
POST_WITHOUT_SLASH = %r[\d{4}\/\d{2}\/[^\/]+$] # http://isbullsh.it/2012/66/here-is-a-title (301 redirects to slash)
POST_WITH_SLASH = %r[\d{4}\/\d{2}\/[\w-]+\/$] # http://isbullsh.it/2012/66/here-is-a-title/
ANY_POST = Regexp.union POST_WITHOUT_SLASH, POST_WITH_SLASH
ANY_PAGE = %r[page\/\d+] # http://isbullsh.it/page/4
ANY_PATTERN = Regexp.union ANY_PAGE, ANY_POST
@rwdaigle
rwdaigle / newrelic.yml
Last active November 24, 2015 07:54 — forked from wuputah/newrelic.yml
New Relic config file for apps on Heroku Cedar
#
# This file configures the New Relic Agent. New Relic monitors
# Ruby, Java, .NET, PHP, and Python applications with deep visibility and low overhead.
# For more information, visit www.newrelic.com.
#
# Generated June 03, 2013
#
# This configuration file is custom generated for Barsoom