Skip to content

Instantly share code, notes, and snippets.

View MuhammetDilmac's full-sized avatar
💻
Working from Home

Muhammet Dilmaç MuhammetDilmac

💻
Working from Home
View GitHub Profile
@Epigene
Epigene / Dokku v0.5.6 Rails App.md
Last active January 5, 2024 14:48
Knowledge-Base for getting a Rails5 app with Cable running on dokku v0.5.6

Dokku v0.5.6 Rails workflow

Straight to Maintenance

0. Set up Droplet

Initialize the droplet with dokku app pre-setup
@seyhunak
seyhunak / seeds.rb
Created December 7, 2013 14:54
Rails - Import SQL file as seed
unless Rails.env.production?
connection = ActiveRecord::Base.connection
connection.tables.each do |table|
connection.execute("TRUNCATE #{table}") unless table == "schema_migrations"
end
sql = File.read('db/import.sql')
statements = sql.split(/;$/)
statements.pop
CREATE TABLE `yok_bolumler` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`fakulteId` varchar(40) NOT NULL,
`universiteId` int(6) NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `fakulteHash` (`fakulteId`)
) ENGINE=MyISAM;
INSERT INTO `yok_bolumler` (`id`, `fakulteId`, `universiteId`, `name`) VALUES
@bellbind
bellbind / capture.c
Last active December 15, 2022 02:18
[linux][v4l2][libjpeg][c99]example for capturing from UVC webcam (on beaglebone black)
/*
* capturing from UVC cam
* requires: libjpeg-dev
* build: gcc -std=c99 capture.c -ljpeg -o capture
*/
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>