Skip to content

Instantly share code, notes, and snippets.

View rootux's full-sized avatar
🌴
Crafting

Gal Bracha rootux

🌴
Crafting
View GitHub Profile
@rootux
rootux / hashtagLinky.js
Created May 1, 2017 11:46 — forked from rishabhmhjn/tweetLinky.js
This is an AngularJS filter to linkify #hashtags and @mention texts into respective Twitter URLsDemo - http://plnkr.co/edit/vrdgxU?p=preview
/* Based on https://gist.github.com/rishabhmhjn/7028079 */
function HashtagLinky($filter, $sce) {
'ngInject'
return function(text, target) {
if (!text) return text;
var replacedText = $filter('linky')(text, target);
var targetAttr = "";
if (angular.isDefined(target)) {
@rootux
rootux / on-scroll-to-bottom.directive.js
Last active April 6, 2017 19:57
Angular 1.5 - Calls a method when user scrolls to bottom
function OnScrollToBottom() {
'ngInject';
let spacing = 40;
return {
restrict: 'A',
link: function (scope, element, attrs) {
const fn = attrs.onScrollToBottom,
@rootux
rootux / Dockerfile
Last active February 17, 2017 17:18 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
@rootux
rootux / Create_New_Dream_In_Cloud
Created January 10, 2017 17:09
Create a new dream folder and copy the budget file and send the link back - used with http://dreams.midburn.org
var dreamsPath = DriveApp.getFolderById('THE-ACTUAL-DRIVE-FOLDER-ID-CAN-BE-COPIED-FROM-URL');
var budgetTemplateFile = DriveApp.getFileById('THE-ACTUAL-DRIVE-BUDGET-FILE-ID-CAN-BE-COPIED-FROM-URL');
var budgetNewFileName = 'Budget - ';
function createDream(dreamerEmail, dreamId, dreamName) {
Logger.log("Got called with " + dreamerEmail +" " + dreamId + " " + dreamName);
var newFolder = createFolder_(dreamerEmail, dreamId,dreamName);
var templateFiles = copyTemplateFilesToFolder_(newFolder, dreamerEmail, dreamName);
var result = {};
result['id'] = newFolder.getUrl();
require 'googleauth/stores/file_token_store'
require 'googleauth/token_store'
# Implementation of google auth storage backed by ENV variable
# Gal Bracha
class EnvTokenStore < Google::Auth::TokenStore
@token = ''
def initialize(options = {})
@rootux
rootux / midburnerot_omg.js
Last active December 11, 2016 12:46
Midburnerot omg sale shuffle from array of emails
/*
* Based on Fisher-Yates (Aka Knuth) shuffle
* https://github.com/Daplie/knuth-shuffle
*/
Array.prototype.shuffle = function() {
let currentIndex = this.length, temporaryValue, randomIndex;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
@rootux
rootux / create_safetyfile.gs
Last active November 21, 2016 22:53
Creates a Safety file from
/**
* Generate Google Docs based on a template document and data incoming from a Google Spreadsheet
*
* License: MIT
*
* Copyright 2013 Mikko Ohtamaa, http://opensourcehacker.com
*
* Modified by Gal Bracha for http://dreams.midburnerot.com
* This is the source file from which we generate the Safety file template
* https://docs.google.com/document/d/1jTb-7Y3ApVchQwqfw7CcKstBNAt8-rmwtLMYU4oi2jk/edit?usp=sharing
@rootux
rootux / MouseControl.h
Created June 24, 2016 13:04 — forked from chuckleplant/MouseControl.h
Mouse control for Windows in C++. Dependencies: User32 Windows library.
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x500
#endif
#include "Winuser.h"
#include "windef.h"
class ofxMouse
{
public:
static enum MouseEventFlags
/**
* Write a description of class BusArrival here.
*
* @author (your name)
* @version (a version number or a date)
*/
/*# Joni: no API documentation */
public class BusArrival
{
@rootux
rootux / WhatsApp Web Send Random Heart
Last active October 18, 2020 01:06
Just a simple WhatsApp Web Heart Sender
/*
Simple WhatsApp Web Spam Bot Originally written by Pablode. Modified by Gal Bracha.
Use with love <3. Do not act reckless.
====================================================================================
DISCLAIMER: I do not take any responsibility for any damage caused with this script.
WhatsApp might be able identify script users if this becomes a problem. Do only use
this if you are aware of the consquences.
====================================================================================
Usage: Copy all of this script (Ctrl+A, Ctrl+C). Add a new Bookmark. In the URL section,
write "javascript:" and paste (Ctrl+V) this script. Visit WhatsApp Web, select your