Skip to content

Instantly share code, notes, and snippets.

View ctwhome's full-sized avatar
🌍

Jes Gonzalez ctwhome

🌍
View GitHub Profile
@Matt-Jensen
Matt-Jensen / Firebase Local Storage IndexedDb Dump.js
Created February 17, 2020 17:04
Access your Firebase Auth Token by dumping your IndexedDB session
(() => {
const asyncForEach = (array, callback, done) => {
const runAndWait = i => {
if (i === array.length) return done();
return callback(array[i], () => runAndWait(i + 1));
};
return runAndWait(0);
};
const dump = {};
@megabayt
megabayt / gist:3b1b60c39720e1ba1208a6787f1b975a
Created November 7, 2017 11:03
Add floor and skybox to threejs
// FLOOR
var floorTexture = new THREE.ImageUtils.loadTexture( 'images/checkerboard.jpg' );
floorTexture.wrapS = floorTexture.wrapT = THREE.RepeatWrapping;
floorTexture.repeat.set( 10, 10 );
var floorMaterial = new THREE.MeshBasicMaterial( { map: floorTexture, side: THREE.DoubleSide } );
var floorGeometry = new THREE.PlaneGeometry(30, 30, 0, 0);
var floor = new THREE.Mesh(floorGeometry, floorMaterial);
floor.position.y = -0.5;
floor.rotation.x = Math.PI / 2;
scene.add(floor);
@kerryboyko
kerryboyko / README.md
Last active April 26, 2023 16:08
VueJS Best Practices Guide

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 7, 2024 11:19
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@efernandesng
efernandesng / component.js
Created March 9, 2016 14:41
react-intl injectIntl decorator
import React, {Component, PropTypes} from 'react';
import {intlShape} from 'react-intl';
import {injectIntl} from './decorator';
@injectIntl()
class Xpto extends Component {
static propTypes = {
intl: intlShape.isRequired
};
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 7, 2024 09:29
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@maccman
maccman / counter.sql
Created July 7, 2013 03:11
Postgres counter cache using triggers.
--
-- Name: c_posts_voted(); Type: FUNCTION; Schema: public; Owner: -
--
CREATE FUNCTION c_posts_voted() RETURNS trigger
LANGUAGE plpgsql
AS $$ BEGIN
UPDATE "posts" SET voted_user_ids = array_append(voted_user_ids, NEW.user_id) WHERE "id" = NEW.post_id;
RETURN NEW;
END;
@rietta
rietta / remove_and_reinstall_homebrew.sh
Created March 17, 2013 03:01
Reinstall Homebrew (Mac OS X)
# Thanks to http://dev.enekoalonso.com/2011/08/09/uninstalling-brew-so-i-can-reinstall/
cd `brew --prefix`
rm -rf Cellar
brew prune
rm -rf Library .git .gitignore bin/brew README.md share/man/man1/brew
rm -rf ~/Library/Caches/Homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
@lovasoa
lovasoa / README.md
Last active January 21, 2021 19:56
Compute the intersection of large arrays in javascript

WARNING : This code now lives in its own github repository: lovasoa/fast_array_intersect. It is also published on npm: fast_array_intersect

Array intersect

Fastest function to intersect a large number of big arrays in javascript, without dependencies

  • The compressed version is only 345 caracters long.
  • Faster than common libraries, even a large number of arrays, or on very big arrays. (See benchmarks)