Skip to content

Instantly share code, notes, and snippets.

View Angeldude's full-sized avatar

Angel Vanegas Angeldude

View GitHub Profile
##############################
## Java
##############################
.mtj.tmp/
*.class
*.jar
*.war
*.ear
*.nar
hs_err_pid*
@Angeldude
Angeldude / profiles.json
Created April 13, 2020 14:50 — forked from trajano/settings.json
Windows Terminal (with git bash and additional shortcuts)
{
"globals" :
{
"alwaysShowTabs" : true,
"copyOnSelect" : false,
"defaultProfile" : "{00000000-0000-0000-ba54-000000000001}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
[
@Angeldude
Angeldude / dotnetlayout.md
Created April 8, 2020 19:36 — forked from davidfowl/dotnetlayout.md
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@Angeldude
Angeldude / pascal_odd.js
Created December 9, 2019 03:20
Calculates the odd numbers for a given row in Pascal's odd triangle
function oddRow(n){
let final = []
let total = (n*(n+1))*0.5;
let start = total-(n-1)
for(let i = start; i <= total; i++){
final.push((i*2)-1);
}
return final
}
@Angeldude
Angeldude / can_be_palindrome.py
Created December 9, 2019 00:32
A function to check if a string can be re-arranged into a palindrome.
def can_make_palindrome2(string):
letters = set(string)
length = len(string)
if length & 1:
temp = map(lambda x: string.count(x) & 1, letters)
return any(temp) and not(any(temp))
else:
return all(map(lambda x: not(string.count(x) & 1), letters))
@Angeldude
Angeldude / fixed.py
Last active March 14, 2019 00:35
Made this code work!
# Enter your code here. Read input from STDIN. Print output to STDOUT
string = "% percent of the lowest 1 2 3, for five 9??? WHat the FUCK!"
string = string.lower().split(' ')
seen = {}
for i in string:
temp = ''.join(list(filter(lambda x: x.isalpha(), i)))
if temp:
if temp in seen:
seen[temp] += 1
@Angeldude
Angeldude / fuck_you_replit.rb
Last active February 27, 2019 04:28
Don's hash problem in ruby
some_array_of_hashes = [
{a: 1, b: 1, c: 1, d: 2, e: 4},
{a: 1, b: 1, c: 1, d: 5, e: 1},
{a: 1, b: 1, c: 1, d: 7, e: 8},
{a: 1, b: 1, c: 1, d: 9, e: 6},
{a: 1, b: 1, c: 2, d: 2, e: 3},
{a: 1, b: 1, c: 3, d: 2, e: 3},
{a: 1, b: 1, c: 4, d: 2, e: 3},
]
@Angeldude
Angeldude / plpgsql.rake
Created February 18, 2019 21:30 — forked from rietta/plpgsql.rake
Are you using PostgreSQL and don't want to make your app run as PostgreSQL super user, then add this custom rake task to your `lib/tasks` folder and be happy.
#
# PostgreSQL writes two optional commands to the database schema
# file, called db/structure.sql, that can only be run as a root
# database user. These are not needed actually, so comment them
# out automatically
#
# CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
# COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
#
namespace :db do
@Angeldude
Angeldude / documenting_htss.md
Last active February 13, 2019 04:13
htss exploratory setup

Prerequisites:

Docker installed node/npm installed ruby, rails installed

run npm install

run docker-compose up

@Angeldude
Angeldude / vowels.hs
Last active February 12, 2019 18:54
Counts vowels in a string and returns the count. Written in Haskell
import Data.Set(member, fromList)
import System.Environment(getArgs)
setVowel = fromList "aeiou"
countVowels :: String -> [Integer]
countVowels word = fmap oneLetter word
oneLetter :: Char -> Integer
oneLetter letter = if member letter setVowel then 1 else 0