Skip to content

Instantly share code, notes, and snippets.

View iamtekeste's full-sized avatar
🕺
having fun with code

Tekeste Gebreanenia iamtekeste

🕺
having fun with code
View GitHub Profile
@iamtekeste
iamtekeste / colors.json
Created August 3, 2019 15:12
Brand Colors for major companies
{
"500px": [
"0099e5",
"ff4c4c",
"34bf49"
],
"About.me": [
"00a98f"
],
"Adidas": [
@iamtekeste
iamtekeste / background.html
Created November 9, 2018 21:29 — forked from erkie/background.html
Save parts of screen using Chrome extension
<script>
var Constants = {
saveURL: 'http://random/birthday/saveimage.php',
w: 500,
h: 500,
x: 200,
y: 200
};
@iamtekeste
iamtekeste / gifenc.sh
Created September 6, 2018 01:43 — forked from Brainiarc7/gifenc.sh
#gif with text overlay #generator using #ffmpeg - inspired by http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
#!/bin/bash
#parameters:
# $1 - mp4 url
# $2 - start time in format hh:mm:ss.mic
# $3 - duration in seconds
# $4 - text for gif overlay
# $5 - output file without extension
if [ "$#" -ne 5 ]
then
echo "Usage: gifenc.sh \$1 \$2 \$3 \$4 \$5
@iamtekeste
iamtekeste / README.md
Created August 8, 2018 18:54 — forked from oodavid/README.md
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@iamtekeste
iamtekeste / gist:5414131089cbcc6b117a10691abf9385
Created July 31, 2018 20:26 — forked from aral/gist:84ddf7ac37be079632ab
NSPopover .appearance property is NSAppearance in Swift, not NSPopoverAppearance as per the docs
// The docs say that the appearance property of an NSPopover should be set to an
// NSPopoverAppearance enum but it actually expects an NSAppearance instance.
// e.g., in an NSViewController subclass:
let popover = NSPopover()
popover.contentViewController = self.storyboard?.instantiateControllerWithIdentifier("someViewController") as? NSViewController
popover.appearance = NSAppearance(named: NSAppearanceNameVibrantLight)
popover.behavior = NSPopoverBehavior.Transient
@iamtekeste
iamtekeste / cleanup-git-repo.js
Last active May 8, 2017 13:17
This is a NodeJS script to clean up our remote git repository by deleting branches we longer need. I have commented out the line that does the actual deletion for the time being.
#!/usr/bin/env node
'use strict';
const fs = require('fs');
const readline = require('readline');
const execSync = require('child_process').execSync;
const config = {
filterText: 'DISCO-',
@iamtekeste
iamtekeste / angular-http-interceptors.js
Created October 6, 2016 18:38
Angular HTTP interceptors
(function(){
angular.module('awesomeApp', [])
.config(function($httpProvider){
$httpProvider.interceptors.push('myInterceptors');
})
.factory('myInterceptors', function(){
return {
request: function(config){
//any code you put here will be executed right before you make the request
//config here refers to the $http config object, you are okay to modify it
@iamtekeste
iamtekeste / *.md
Created July 4, 2016 18:53 — forked from toddmotto/*.md
How I lost 20kg/3stone/44lbs

Everytime I tweet about losing weight and posting images, a lot of people ask questions - so thought I'd write something decent down about what I've done so far and am currently working on.

12 months change:

Necessary changes

Step 1: Fixing your diet

My diet used to be so so bad, energy drinks, constant sugar intake. Kill that! I also used to order takeaways at least 2-3 times a week, because it was easy and the bigger you get the lazier you get from my experience.

@iamtekeste
iamtekeste / git foce pull.sh
Created June 19, 2016 03:44
Git Commands to Overwrite Local Files
git fetch --all
$ git reset --hard origin/master
To download changes from some other branch use the following command.
$ git reset --hard origin/other_branch
@iamtekeste
iamtekeste / functions.php
Created October 30, 2015 15:16 — forked from levymetal/direct_parent.php
Custom Wordpress function which uses a nav walker to display a list of child pages from a common parent, which can be called from either the parent page (displays children) or any of the child pages (displays siblings). Detailed instructions available on my blog post here: http://christianvarga.com/how-to-get-submenu-items-from-a-wordpress-menu-…
<?php
// add hook
add_filter( 'wp_nav_menu_objects', 'my_wp_nav_menu_objects_sub_menu', 10, 2 );
// filter_hook function to react on sub_menu flag
function my_wp_nav_menu_objects_sub_menu( $sorted_menu_items, $args ) {
if ( isset( $args->sub_menu ) ) {
$root_id = 0;