Skip to content

Instantly share code, notes, and snippets.

@demirhanaydin
demirhanaydin / arduino-hc-10-test.ino
Last active December 25, 2020 21:16
Arduino AT commands for hc-10 ble module
// list of hc-10 AT commands
// http://fab.cba.mit.edu/classes/863.15/doc/tutorials/programming/bluetooth/bluetooth40_en.pdf
// If you haven't configured your device before use this
#define BLUETOOTH_SPEED 9600 //This is the default baudrate that HC-10 uses
#include <SoftwareSerial.h>
// Swap RX/TX connections on bluetooth chip
// Pin 10 --> Bluetooth TX
@demirhanaydin
demirhanaydin / create_and_apply_patch_with_git
Created July 3, 2015 08:11
Create and apply patch with Git
# source https://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/
git checkout -b fix_empty_poster
# do some commits to new branch
# create patch file
git format-patch master --stdout > fix_empty_poster.patch
# check stats
git apply --stat fix_empty_poster.patch
# check errors if any
git apply --check fix_empty_poster.patch
# apply it
# The VirtualBox documentation[1] for how to install guest additions
# for Linux on a virtual host is somewhat messy. So here is what
# I did to make it work.
# Install the packages required
yum update
yum install gcc kernel-devel make
reboot

Grab new backup of database

Command: heroku pgbackups:capture --remote production

Response: >>> HEROKU_POSTGRESQL_COLOR_URL (DATABASE_URL) ----backup---> a712

Get url of backup download

Command: heroku pgbackups:url [db_key] --remote production

@demirhanaydin
demirhanaydin / pi-blink.rb
Created October 12, 2013 13:01
Led blink example with pi_piper on Raspberry Pi
@demirhanaydin
demirhanaydin / tire-parent-child-example.rb
Last active December 22, 2015 23:48
Elasticsearch parent/child example with tire
require 'rubygems'
require 'tire'
Tire.configure { logger 'elasticsearch.log', :level => 'debug' }
class Document
attr_accessor :title, :content
include Tire::Model::Persistence
include Tire::Model::Search
include Tire::Model::Callbacks