Skip to content

Instantly share code, notes, and snippets.

View wok's full-sized avatar

Wolfgang Kölbl wok

View GitHub Profile
@wok
wok / cloudSettings
Created January 24, 2019 08:07
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-01-24T08:07:43.531Z","extensionVersion":"v3.2.4"}
@wok
wok / android-emulator-homebrew.sh
Last active November 8, 2018 06:18 — forked from spilth/android-emulator-homebrew.sh
Android Emulator with Homebrew
touch ~/.android/repositories.cfg
brew cask install caskroom/versions/java8
brew cask install android-sdk
brew cask install intel-haxm
export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"
sdkmanager "platform-tools" "platforms;android-28" "extras;intel;Hardware_Accelerated_Execution_Manager" "build-tools;28.0.0" "system-images;android-28;google_apis;x86" "emulator"
avdmanager create avd -n test -k "system-images;android-28;google_apis;x86"
/usr/local/share/android-sdk/tools/emulator -avd test
(function() {
'use strict';
function ready(fn) {
if (document.readyState != 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
@wok
wok / multi_statements_mysql2.rb
Created November 15, 2011 19:02
ActiveRecord MULTI_STATEMENTS with mysql2
# place in config/initalizers
module ActiveRecord
class Base
# Establishes a connection to the database that's used by all Active Record objects.
def self.mysql2_connection(config)
config[:username] = 'root' if config[:username].nil?
if Mysql2::Client.const_defined? :FOUND_ROWS
config[:flags] = Mysql2::Client::FOUND_ROWS | Mysql2::Client::MULTI_STATEMENTS
@wok
wok / codeship.rake
Created April 7, 2016 12:27
codeship.rake
namespace :db do
desc 'Drops all tables in the database'
task drop_all_tables: :environment do
fail 'Only allowed in test environment' unless Rails.env.test?
connection = ActiveRecord::Base.connection
case connection.adapter_name
# SQL Server via TinyTDS
when 'SQLServer'
# Usage
# copy this file to a new director e.g. /root/chef
# run a single recipe as follows:
# ./local_chef.sh -o recipe[myclub::backup]
# put the cookbook path in solo.rb file.
echo 'cookbook_path ["/opt/aws/opsworks/current/merged-cookbooks"]' > solo.rb
# create json file incase if you want use the attributes from opsworks.
opsworks-agent-cli get_json > attributes.json
{
"type": "email",
"customer": {
"email": "customer@example.com",
"firstName": "Jack",
"lastName": "Test 2"
},
"subject": "I need help #17",
"mailbox": {
"id": 16671
var char = '',
morseToChar = {
'.-': 'a',
'-...': 'b',
'-.-.': 'c',
'-..': 'd',
'.': 'e',
'..-.': 'f',
'--.': 'g',
'....': 'h',
Pod::Spec.new do |s|
s.name = 'Countly'
s.version = '1.0.0-master'
s.license = {
:type => 'COMMUNITY',
:text => <<-LICENSE
COUNTLY MOBILE ANALYTICS COMMUNITY EDITION LICENSE
--------------------------------------------------
Copyright (c) 2012, 2013 Countly
@wok
wok / index.html
Last active December 14, 2015 06:09
select2 - jQuery UI 1.10
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
<script src="select2.js"></script>
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css"/>
<link rel="stylesheet" type="text/css" href="select2.css"/>
<style type="text/css">
select { width: 300px; }