Skip to content

Instantly share code, notes, and snippets.

@bluehallu
bluehallu / bugtest.rb
Created July 6, 2016 18:56
BugTestScript
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
@bluehallu
bluehallu / app.js
Created April 23, 2014 09:12
sidemenu demo patch
.state('register', {
url: "/register",
templateUrl: "templates/register.html",
controller: 'RegisterCtrl',
onEnter: function ($state) {
//$state.go('app.playlists');
}
})
.factory('machinesCache', function() {
var _model = {machines: null};
return {
setMachines: function(data) {
_model.machines = data;
},
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.mongodb</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/mongodb/mongod</string>
<string>--config</string>
# Store data in /usr/local/var/mongodb instead of the default /data/db
dbpath = /usr/local/var/mongodb
# Append logs to /usr/local/var/log/mongodb/mongo.log
logpath = /usr/local/var/log/mongodb/mongo.log
logappend = true
# Only accept local connections
bind_ip = 127.0.0.1
am.directive("showXeditable", function() {
return {
link: function(scope, element, attrs) {
if(attrs.isnew){
scope.$editable.show();
}
},
require: 'editableText',
restrict: 'A',
priority: 1000 //ensure it runs AFTER editableText directive
print(" A B C D E F G H")
for fila in range(8):
print(8-fila,end=" ")
for columna in range(8):
if columna%2 == fila%2:
print("\u25a1",end=" ")
else:
print("\u25a0",end=" ")
print(8-fila)
print(" A B C D E F G H")
num=0
print("ABCDEFGH")
for fila in range (0,8):
print(num,end="")
for columna in range (0,8):
if columna%2 == fila%2:
print("\u25a1",end="")
else:
print("\u25a0",end="")
print(num,end="")
num=0
print("ABCDEFGH")
for fila in range (1,9):
print(num+1,end="")
for columna in range (1,9):
if columna%2 == fila%2:
print("\u25a1",end="")
else:
print("\u25a0",end="")
print(num+1,end="")
@bluehallu
bluehallu / Movi.rb
Last active December 26, 2015 05:19
class Movie < ActiveRecord::Base
belongs_to :channel
validate :does_not_overlap, :valid_times
def self.from_xml(xml)
id = xml.attr('id') #parse movie id
channel = Channel.find_by_codename(xml.child.name) #get the channel from db
name = xml.child.xpath('name').text #get name
start_time = parse_time(xml.child.xpath('start_time').text)
end_time = parse_time(xml.child.xpath('end_time').text)