Skip to content

Instantly share code, notes, and snippets.

View dflima's full-sized avatar
📱
developing stuff

Danilo dflima

📱
developing stuff
View GitHub Profile
package main
import "fmt"
func main() {
//Enter your code here. Read input from STDIN. Print output to STDOUT
var input int
fmt.Scanf("%d", &input)
for i := 1; i <= 10; i++ {
output := input * i
package main
import "fmt"
func PrintEvenIndexes(array []byte) {
for i := range array {
if i % 2 == 0 {
fmt.Printf("%s", string(array[i]))
}
}
}
pidof "$@" | xargs -0 -r kill -SIGTERM
solveMeFirst a b = a + b
main = do
val1 <- readLn
val2 <- readLn
let sum = solveMeFirst val1 val2
print sum
f :: Int -> [Int] -> [Int]
f n arr = concatMap (replicate n) arr
-- This part handles the Input and Output and can be used as it is. Do not modify this part.
main :: IO ()
main = getContents >>=
mapM_ print. (\(n:arr) -> f n arr). map read. words
f :: [Int] -> [Int]
f lst = map ((!!)lst) [1,3..length lst-1]
-- This part deals with the Input and Output and can be used as it is. Do not modify it.
main = do
inputdata <- getContents
mapM_ (putStrLn. show). f. map read. lines $ inputdata
#!/bin/bash
echo "Enter number to be converted: "
read no
echo "Converting $no from decimal to binary (base2)"
no=`echo "obase=2;$no" | bc`
echo Binary: $no
echo "Converting binary($no) to decimal"
no=`echo "obase=10;ibase=2;$no" | bc`
<?php
for ($i = 1; $i < 200; $i++) {
$a = load($i);
echo "You have allocated {$i}M (".memory_get_usage().") memory in this php script\n";
unset($a);
}
function load($i)
@dflima
dflima / delete_merged_branches.sh
Last active July 8, 2017 02:50
Deletes branches merged with <branch>
#!/bin/bash
function usage()
{
printf "Usage:\n\n"
printf "./delete_merged_branches <branch>\n\n"
}
if [ "$1" == "" ]; then
usage