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 / window-prevent-reload.js
Last active February 1, 2021 15:58
2 methods for binding and unbinding window.onbeforeunload event
var windowReloadBind = function(message) {
window.onbeforeunload = function(event) {
if (message.length === 0) {
message = '';
}
if (typeof event == 'undefined') {
event = window.event;
}
if (event) {
@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 / gist:ffea20da9d0b0452a47d
Created September 20, 2015 06:40
install lsyncd mac 10.11
brew update
brew install lsyncd
// if Error: lsyncd does not define resource "xnu"
// vi /usr/local/Library/Formula/lsyncd.rb
// add to xnu_headers -- "10.11" => ["xnu-2782.1.97.tar.gz", "c99cf8ec04c29d40b771652241dd325e4977d92b"],
// run brew install lsyncd again
sudo mkdir /var/log/lsyncd
sudo touch /var/log/lsyncd/lsyncd.{log,status}