Skip to content

Instantly share code, notes, and snippets.

View jasalt's full-sized avatar

Jarkko Saltiola jasalt

View GitHub Profile
from flask import Flask
from secrets import g_user, g_pass
from datetime import datetime
app = Flask(__name__)
import gspread
# Helpers
@jasalt
jasalt / app.js
Created October 22, 2014 02:08
pebble-coffee-watch-app
/* Helpers */
// Send request to server
var sendRequest = function(substance){
var req = new XMLHttpRequest();
req.open('GET', 'http://XXsecretXX:YY/' + substance, true);
req.onload = function (e) {
if (req.readyState === 4) {
if (req.status === 200) {
@jasalt
jasalt / usbreset.c
Last active September 5, 2015 07:31 — forked from x2q/usbreset.c
/* usbreset -- send a USB port reset to a USB device
*
* Compile using: gcc -o usbreset usbreset.c
*
*
* */
@jasalt
jasalt / heroku-caffeine.py
Created September 5, 2015 13:30
Heroku Caffeine, free node daytime keepalive script
# "Free dynos are allowed 18 hours awake per 24 hour period."
# This script keeps the free Heroku dyno awake during daytime.
# During night, user needs to wait ~10s for server wakeup.
# Tested on Python 2.7.6, should work on *nix machines.
# (On Python 3 urllib2 is changed to urllib3..)
# Configuration & Usage:
# - Setup server endpoints in KEEP_AWAKE_SERVERS env var, separated by space.
# eg. `export KEEP_AWAKE_SERVERS="http://app955.herokuapp.com http://asd.me"`
@jasalt
jasalt / iterm
Last active September 21, 2015 19:02 — forked from bobthecow/tab.bash
Open new Terminal tabs from the command line
#!/bin/bash
#
# Open new Terminal tabs from the command line to currently running ITerm2
# session
#
# Author: Justin Hileman (http://justinhileman.com)
# Modified by: Jarkko Saltiola (http://saltio.la)
#
# Installation:
# Add this file path
@jasalt
jasalt / instapusher.py
Last active February 24, 2024 03:39
Instapusher - automatic instagram uploads from a directory
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Instapusher. Push images from a directory automatically to Instagram.
# Schedule script with cron eg:
# 0 18 * * * /path/to/instapusher --login <your_username> \
# --password <your_password> --random-delay 30 <dir>
@jasalt
jasalt / dldjbb.py
Last active September 26, 2016 10:15 — forked from kamiheku/djbb.py
Simple Break Beat Paradise downloader
#!/usr/bin/env python3
# Download all zip files from a single bbp page eg:
# ./djbb.py http://www.breakbeat-paradise.com/samplesite/bb_synth.php
import requests
import re
import shutil
import sys
@jasalt
jasalt / gist:0a684cf0bb620bf95f02582f6dbc1a97
Created September 19, 2017 16:33
Making money is killing your business highlights
==========
Making Money is Killing Your Business (Blakeman, Chuck;Seeling, Caleb)
- Added on Thursday, June 19, 2014 10:07:49 AM
We’re too busy making money to get to the important stuff. As a result everything is backwards. We build a business and take whatever lifestyle that business happens to throw off for us, which at best usually involves having money, but rarely a lot of time, and almost never significance.This isn’t surprising because “he who makes the rules wins,” and we too often let our business and the business world around us make the rules for us.
==========
- Added on Thursday, June 19, 2014 10:23:04 AM
If we gain clarity about where we are and where we want to go, and a measure of clarity about the first few steps to get there, that gives us hope. Not hope in the modern sense of wishing, but hope in the correct sense of the word—believing with conviction that I can do it.
==========
@jasalt
jasalt / Instructions.sh
Created June 7, 2018 16:10 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by