Skip to content

Instantly share code, notes, and snippets.

View woss's full-sized avatar
🛸

Daniel Maricic woss

🛸
View GitHub Profile
#!/bin/sh -x -v
for i in "$@"
do
case $i in
-key=*|--license-key=*)
YOURLICENSEKEY="${i#*=}"
;;
-app=*|--app-name=*)
APP_NAME="${i#*=}"
@woss
woss / gist:95a082c44819a934aa65
Last active August 29, 2015 14:03
heywatch sample
<?php
/**
* Create one job and put it to the queue
* @param array $job
* @return $this
*/
public function createJob(array $job)
{
/**
* These are our own defaults, API defaults are here
<?php
/**
* Create jobs
* @param $videoId int
* @return $this
*/
public function createJobs($videoId)
{
$this->setVideoId($videoId);
$this->setVideoTitle($this->getVideoInfo($videoId)['title']);
// ref -> profiles/ID/appData
appData = {
age: moment().diff(profile.birthday, 'years'),
gender: profile.gender,
name: profile.given_name,
pictures: [{
small: profile.picture,
large: ''
}],
description: '',
@woss
woss / README.md
Last active August 29, 2015 14:22 — forked from oodavid/README.md

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

#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@woss
woss / install-mongodb.sh
Last active September 11, 2015 08:16
Installation from MongoDb official tutorial
#!/bin/bash
#How to use it?
# wget -O- https://gist.githubusercontent.com/woss/4e39e4cb1d19daa70876/raw/19c7ad1f4c83b32a06fd3d3a3b77181d74daa993/install-mongodb.sh | sh
LOG_TIME_FORMAT='date +%d-%m-%Y_%T'
echo "------------------------------------------"
echo "Install MongoDB on Ubuntu"
echo "------------------------------------------"
#!/bin/bash
sudo apt-get update
sudo apt-get install \
git \
autoconf \
bison \
pkg-config \
libbz2-dev \
@woss
woss / LocalBroadcastExampleActivity.java
Created October 10, 2015 07:59 — forked from Antarix/LocalBroadcastExampleActivity.java
Simple Example of using LocalBroadcastManager in Android
import android.app.Activity;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
@woss
woss / dropzone-directive.js
Created December 31, 2015 11:05 — forked from compact/dropzone-directive.js
AngularJS directive for Dropzone.js
/**
* An AngularJS directive for Dropzone.js, http://www.dropzonejs.com/
*
* Usage:
*
* <div ng-app="app" ng-controller="SomeCtrl">
* <button dropzone="dropzoneConfig">
* Drag and drop files here or click to upload
* </button>
* </div>