Skip to content

Instantly share code, notes, and snippets.

@lucianghinda
lucianghinda / automator_new_markdown_file.applescript
Last active August 29, 2015 14:21 — forked from rarylson/automator_new_file.scpt
Change the filetype to markdown .md and automatically open it with iA Writer without renaming.
on run {input, parameters}
set file_name to "untitled"
set file_ext to ".md"
set is_desktop to false
-- get folder path and if we're in desktop (no folder opened)
try
tell application "Finder"
set this_folder to (folder of the front Finder window) as alias
@lucianghinda
lucianghinda / count-domains-and-paths.rb
Created January 23, 2017 17:10
Count domains and paths
# Script to counts subdomains and URL paths from a list
# Gem List Used:
# https://github.com/gilliek/opml-parser
# https://github.com/mhuggins/dominatrix
require 'opml-parser'
require 'domainatrix'
require 'pp'
require 'csv'
include OpmlParser
@lucianghinda
lucianghinda / kill-adobe-creative-cloud.sh
Created March 13, 2017 08:47
Kill all Adobe Processes
#!/bin/bash
ps axuwww | grep Adobe --exclude='grep' | awk '{print $2}' | xargs sudo kill -9
attributes = ["new", "reimagined", "innovative", "special", "simplified", "focused"]
seeds_one = ["buy", "choose", "help", "assist them in", "create", "control", "merge", "ease", "deliver", "arrange"]
seeds_two = ["foods", "clothes", "virtual", "arrange", "map", "online", "path", "choice", "talk", "items", "visits", "duration", "cart", "move", "view", "deliver", "package", "access"]
seeds_simple_operator = ["and", "or"]
seeds_join_operator = ["and", "or", "in context of", "to help with", "to solve"]
(1..30).each do |no|
idea_type = "A #{attributes.sample} service"
idea_type = "A #{attributes.sample} mobile app" if no % 4 == 0
idea_type = "A #{attributes.sample} portal" if no % 5 == 0

Keybase proof

I hereby claim:

  • I am lucianghinda on github.
  • I am lucianghinda (https://keybase.io/lucianghinda) on keybase.
  • I have a public key whose fingerprint is 7463 7166 1EA9 9D4A 24D3 BFBF 4571 D22B 9926 4561

To claim this, I am signing this object:

@lucianghinda
lucianghinda / post_migration_index_checker.rake
Created October 11, 2018 03:17
Enhance Migration to Check for Foreign Keys
# Script copied from https://alexpeattie.com/blog/stop-forgetting-foreign-key-indexes-in-rails-post-migration-script
Rake::Task['db:migrate'].enhance do
tables = ActiveRecord::Base.connection.tables
all_foreign_keys = tables.flat_map do |table_name|
ActiveRecord::Base.connection.columns(table_name).map {|c| [table_name, c.name].join('.') }
end.select { |c| c.ends_with?('_id') }
indexed_columns = tables.map do |table_name|
ActiveRecord::Base.connection.indexes(table_name).map do |index|
index.columns.map {|c| [table_name, c].join('.') }
@lucianghinda
lucianghinda / SketchSystems.spec
Created December 15, 2019 21:22
Iteration in Acertivo
Iteration in Acertivo
Logged in*
User Answers -> Assessment Answered
Assessment Answered
Notify Psychologist -> Evaluating Assessment
Evaluating Assessment
Review assignment -> Evaluated
Evaluated
Add skills to learn -> Start Learning
Start Learning
@lucianghinda
lucianghinda / signup_test.exs
Last active February 24, 2020 09:26
Test Case for verifying Signup Form with valid data - written in Elixir
defmodule SignupTest do
use ExUnit.Case
use Hound.Helpers
alias Ecto.Adapters.SQL.Sandbox
hound_session()
setup do
:ok = Sandbox.checkout(App.Repo)
@lucianghinda
lucianghinda / signup.spec.js
Created February 24, 2020 09:30
Test Case for verifying signup form with valid data - written in Javascript using Cypress.io
/// <reference types="Cypress" />
const faker = require("faker");
describe("Signup", function() {
it("it should work with valid data", function() {
let first_name = faker.name.firstName();
let password = faker.random.uuid();
let date = new Date();
let timestamp = date.getTime();
let email = "first_name@" + faker.internet.domainName();
@lucianghinda
lucianghinda / .licensed.yml
Last active June 22, 2020 14:02
Example of Licensed configuration file sample for a Ruby on Rails project
sources:
bundler: true
allowed:
- mit
- apache-2.0
- bsd-2-clause
- bsd-3-clause
- isc
- cc0-1.0