Skip to content

Instantly share code, notes, and snippets.

View hotsen's full-sized avatar
💭
Pending

Alexander hoth hotsen

💭
Pending
View GitHub Profile
## The Final Git Ignore File for Rails Applications (almost) ##
# ---------------------------------------------------------------------------------------------- #
#
# Development, yeah ...
# ---------------------------------------------------------------------------------------------- #
/log
/tmp
@hotsen
hotsen / Ultimate setup
Last active August 29, 2015 14:21
Put this into bin folder of a rails 4.2 app and run it ...
#!/usr/bin/env ruby
require 'pathname'
# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
Dir.chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file:
@hotsen
hotsen / character_set_and_collation.rb
Created December 17, 2015 21:46 — forked from tjh/character_set_and_collation.rb
Convert all Rails table column collation and character set
#!/usr/bin/env ruby
# Put this file in the root of your Rails project,
# then run it to output the SQL needed to change all
# your tables and columns to the same character set
# and collation.
#
# > ruby character_set_and_collation.rb
DATABASE = ''
#!/bin/bash
# Allow toggling components to install and update based off flags
updateconsul=1
updatedocker=1
updatedockermachine=1
updatedockercompose=1
updatedockerswarm=1
consulversion="0.5.2"
@hotsen
hotsen / install-docker.sh
Created May 17, 2016 19:15 — forked from katopz/install-docker.sh
Install Docker on Ubuntu 14.04
# Install Docker on Ubuntu 14.04
# Ref https://docs.docker.com/engine/installation/linux/ubuntulinux/
# Update your APT package index.
sudo apt-get update
# Ensure that APT works with the https method, and that CA certificates are installed.
sudo apt-get install apt-transport-https ca-certificates
# Add the new GPG key.
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
# Add docker.list
sudo echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list
@hotsen
hotsen / RCTWebSocketExecutor.m
Created July 19, 2016 20:34 — forked from mschwartz/RCTWebSocketExecutor.m
Fix WebSocket URL to debug on target
- (instancetype)init
{
// return [self initWithURL:[RCTConvert NSURL:@"http://localhost:8081/debugger-proxy"]];
NSString *serverIP = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"SERVER_IP"];
NSString *debugUrlString = [NSString stringWithFormat:@"http://%@:8081/debugger-proxy", serverIP];
return [self initWithURL:[RCTConvert NSURL:debugUrlString]];
}
@hotsen
hotsen / Run Script.sh
Created July 19, 2016 20:34 — forked from mschwartz/Run Script.sh
"Run Script" for React Native automatic IP configuration
INFOPLIST="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
echo "writing to $INFOPLIST"
PLISTCMD="Add :SERVER_IP string $(ifconfig | grep inet\ | tail -1 | cut -d " " -f 2)"
echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true
PLISTCMD="Set :SERVER_IP $(ifconfig | grep inet\ | tail -1 | cut -d " " -f 2)"
echo -n "$INFOPLIST" | xargs -0 /usr/libexec/PlistBuddy -c "$PLISTCMD" || true
@hotsen
hotsen / AppDelegate.m
Created July 19, 2016 20:35 — forked from mschwartz/AppDelegate.m
AppDelegate.m fixed for DEBUG, DEVICE, and PRODUCTION builds
#if DEBUG
#if TARGET_OS_SIMULATOR
#warning "DEBUG SIMULATOR"
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
#else
#warning "DEBUG DEVICE"
NSString *serverIP = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"SERVER_IP"];
NSString *jsCodeUrlString = [NSString stringWithFormat:@"http://%@:8081/index.ios.bundle?platform=ios&dev=true", serverIP];
NSString *jsBundleUrlString = [jsCodeUrlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
jsCodeLocation = [NSURL URLWithString:jsBundleUrlString];
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"rc-start": "npm start -- --reset-cache",
"clean": "rm -rf $TMPDIR/react-* && watchman watch-del-all && npm cache clean",
"clean-start": "npm run clean && npm run rc-start",
"fresh-install": "rm -rf $TMPDIR/react-* && watchman watch-del-all && rm -rf ios/build/ModuleCache/* && rm -rf node_modules/ && npm cache clean && npm install",
"fresh-start" : "npm run fresh-install && npm run rc-start",
"tron": "node_modules/.bin/reactotron"
}
# Usage:
# ========
# FirebaseAuth::Auth.verify_id_token(your_id_token)
#
# The method call follows the same API of the Node.js, JAVA and Python SDKs.
# See https://firebase.google.com/docs/auth/admin/verify-id-tokens#verify_id_tokens_using_the_firebase_admin_sdk
# Dependencies:
# ---------------
# gem 'activesupport'