Skip to content

Instantly share code, notes, and snippets.

View eladg's full-sized avatar
👷‍♂️
Looking for work

Elad Gariany eladg

👷‍♂️
Looking for work
View GitHub Profile
@eladg
eladg / heroku_sync_dotenv
Last active August 29, 2015 14:14
sync .env to heroku config
#!/bin/bash
for line in `cat .env` ;
do
IFS='='
read -a array <<< "$line"
if [[ ${array[0]} != "#"* ]] ;
then
echo "heroku config:set ${array[0]}=${array[1]}"
fi
done
@eladg
eladg / pre-commit
Last active August 29, 2015 14:23 — forked from Simbul/pre-commit
#!/usr/bin/env ruby
# This pre-commit hook will prevent any commit to forbidden branches
# (by default, "staging" and "production").
# Put this file in your local repo, in the .git/hooks folder
# and make sure it is executable.
# The name of the file *must* be "pre-commit" for Git to pick it up.
FORBIDDEN_BRANCHES = ["staging", "production", "sandbox"]
This is a short text with couple of words
@eladg
eladg / mess-unfollow-twitter.js
Created October 4, 2015 20:29
Mess Unfollow clicking on Twitter /following page (Oct. 2015)
__cnt__=0; jQuery('button.user-actions-follow-button > span.following-text').each(function (i, ele) { ele = jQuery(ele); if (ele.css('display')!='block') {console.log('already following:', i); return;} setTimeout(function () {ele.click();}, __cnt__++*500); });
@eladg
eladg / project_spec.rb
Created December 29, 2015 04:15
rspec model popular describe block
require 'rails_helper'
RSpec.describe Project, type: :model do
let(:model) { described_class }
describe 'validation' do
end
describe "associations" do
end
@eladg
eladg / bundle.js
Created July 18, 2016 06:20
Simple ReactJS Contacts App
var app = app || {};
(function() {
'use strict';
var ContactsApp = React.createClass({
getInitialState: function() {
// was considering a hash design which would
@eladg
eladg / Equirectangular-to-Stereographic-Projection-Shader.frag
Last active May 7, 2024 16:09
WebGL: stereoscopic projection transformation (Fragment Shader)
// credits to: https://github.com/notlion/streetview-stereographic
precision mediump float;
uniform sampler2D texture;
uniform float scale, aspect, time;
uniform mat3 transform;
varying vec2 v_texcoord;
@eladg
eladg / Heights-shader.frag
Last active November 22, 2022 06:24
WebGL-HeatMap - Shaders in GLSL
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp int;
precision highp float;
#else
precision mediump int;
precision mediump float;
#endif
varying vec2 off, dim;
varying float vIntensity;
var canvas = document.getElementById('heatmap-canvas');
var gl = canvas.getContext('webgl');
var debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
var vendor = gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL);
var renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
console.log(vendor);
console.log(renderer);
var simplexPeer = new function() {
// const
this.ICE_SERVERS = [{
urls: "stun:stun.l.google.com:19302",
}
]
this.CHANNEL_KEY = 'webrtc/channel';
this.SENDER_KEY = 'webrtc/sender-description';