Skip to content

Instantly share code, notes, and snippets.

View elado's full-sized avatar
👨‍💻

Elad Ossadon elado

👨‍💻
View GitHub Profile
@jalberto
jalberto / remote_cache_with_project_root_strategy.rb
Created May 6, 2014 14:17
Capistrano 3.1.x Strategy to deploy git projects with subdirectories
# Usage:
# 1. Drop this file into lib/capistrano/remote_cache_with_project_root_strategy.rb
# 2. Add the following to your Capfile:
# require 'capistrano/git'
# require './lib/capistrano/remote_cache_with_project_root_strategy'
# 3. Add the following to your config/deploy.rb
# set :git_strategy, RemoteCacheWithProjectRootStrategy
# set :project_root, 'subdir/path'
# Define a new SCM strategy, so we can deploy only a subdirectory of our repo.
@xmlking
xmlking / Enum.es6.js
Last active June 25, 2019 18:09
JavaScript Enums with ES6, Type Checking and Immutability
export class EnumSymbol {
sym = Symbol.for(name);
value: number;
description: string;
constructor(name: string, {value, description}) {
if(!Object.is(value, undefined)) this.value = value;
if(description) this.description = description;
@ldong
ldong / download_egghead_videos.md
Last active December 7, 2023 16:16
download egghead videos

Download videos from egghead

Go to the egghead website, i.e. Building a React.js App

run

$.each($('h4 a'), function(index, video){
  console.log(video.href);
});
@longtimeago
longtimeago / squash-commits.md
Last active April 1, 2024 20:44
How to squash commits in a GitHub pull request

How to squash commits in a GitHub pull request

o you've contributed some code to an open source project, say, Rails. And they'd like you to squash all of the commits in your pull request. But you're not a git wizard; how do you make this happen?

Normally, you'd do something like this. I'm assuming upstream is a git remote that is pointing at the official project repository, and that your changes are in your 'omgpull' branch:

React = require 'react'
Perf = require 'react-addons-perf'
ReactDOM = require 'react-dom'
rd = React.DOM
###
Usage: `require('debug/RecordPerfButton').attachToDOM()`
Add to any file to attach a record button to the DOM, toggleable via click and <alt> keypress.
Useful for quickly testing performance as it will:

babel-plugin-transform-mui-imports npm

A plugin to make authoring with MUI components efficient, both for humans and bundlers.

Here's why:

@haggen
haggen / less.js
Created March 5, 2021 13:08
Next.js v9/v10 integration for LESS leveraging built-in support for SASS
const cloneDeep = require("clone-deep");
const { readFileSync, existsSync } = require("fs");
const path = require("path");
// next-less (official plugin to integrate Less) is now
// deprecated so we have to provide our own solution.
//
// Next.js already provides built-in integration with CSS and Sass, but it
// relies on a dynamic WebPack config. generation to do it optimally.
//