Skip to content

Instantly share code, notes, and snippets.

View aalemayhu's full-sized avatar
💭
If at first the idea is not absurd, then there is no hope for it - Albert

Alexander Alemayhu aalemayhu

💭
If at first the idea is not absurd, then there is no hope for it - Albert
View GitHub Profile
@aalemayhu
aalemayhu / commit-lang-change
Created April 29, 2015 03:17
ease committing translation changes
#!/bin/sh
# FROM http://stackoverflow.com/questions/307503/whats-the-best-way-to-check-that-environment-variables-are-set-in-unix-shellscr
[ -z "$LINGUA" ] && echo "Need to set LINGUA" && exit 1;
[ -z "$MANUAL" ] && echo "Need to set MANUAL" && exit 1;
git add -u .
commit_msg=`tempfile`
echo "($LINGUA) Use latest reviewed $MANUAL manual translation" > $commit_msg
echo >> $commit_msg
@aalemayhu
aalemayhu / xdotool
Created April 29, 2015 11:36
script my mouse
#!/bin/sh
# http://tuxradar.com/content/xdotool-script-your-mouse
xdotool mousemove 2470 220
xdotool click 1
sleep 30
xdotool mousemove 2555 427
xdotool click 1
sleep 2
@aalemayhu
aalemayhu / fetch-page
Last active August 29, 2015 14:20
Fetch page as text file using the title for filename
#!/bin/sh
url="$1"
# http://stackoverflow.com/questions/11711339/getting-webpage-title-img-metadata-info-from-linux-terminal
title=$(wget $url -O - | grep \<title\>|sed "s/\<title\>\([^<]*\).*/\1/" | tr ' ' '_')
links -dump $url >> "$title".txt
@aalemayhu
aalemayhu / custom-kernel
Last active August 29, 2015 14:20
build custom kernel
#!/bin/sh
# FROM http://stackoverflow.com/questions/307503/whats-the-best-way-to-check-that-environment-variables-are-set-in-unix-shellscr
[ -z "$DEB_VER" ] && echo "Need to set DEB_VER" && exit 1;
# Modified info from[0].
# install deps to build kernel; apt-get install curl kernel-package fakeroot
# install menu dependency; apt-get install libncurses5-dev
# build configuration; make menuconfig
@aalemayhu
aalemayhu / gen-release-notes
Created May 21, 2015 15:40
ease my life when generating release notes for android apps
#!/bin/bash
src="$1"
dst="$2"
f=/tmp/$dst.md
echo "\`\`\`" > $f
echo "Hei," >> $f
echo "vedlagt er $app_name versjon $dst. Følgende nevneverdige endring har blitt gjort:" >> $f
echo >> $f
for r in `git rev-list $src..$dst`;
do
@aalemayhu
aalemayhu / gist:b124e94e64130f2d8dfc
Created June 10, 2015 11:24
exec chromium search from clipboard
exec chromium-browser "? $(xclip -o)"
@aalemayhu
aalemayhu / SparkGraph.playground
Last active August 29, 2015 14:25 — forked from blakejakopovic/SparkGraph.playground
Test xcode migrator tool
import Cocoa
import XCPlayground
@IBDesignable
class SparkGraph: NSView {
// Background Colour
@IBInspectable var backgroundColor:NSColor?
// Border
@aalemayhu
aalemayhu / helloworld.swift
Last active December 26, 2015 06:04
A sample
print("😀")
@aalemayhu
aalemayhu / 53da58.swift
Last active December 27, 2015 11:40
trying out map
class Named {
let name: String
init(name: String) {
self.name = name
}
}
let cat = Named(name: "cat")
let dog = Named(name: "dog")
@aalemayhu
aalemayhu / 160e96.swift
Created December 27, 2015 19:07
playing
import Foundation
func cmd(launchPath: String, args: [String]?) -> NSString? {
let task = NSTask()
task.launchPath = launchPath
if let arguments = args {
task.arguments = arguments
}