Skip to content

Instantly share code, notes, and snippets.

View xShivan's full-sized avatar

Michał Cywiński xShivan

View GitHub Profile
@xShivan
xShivan / install consolas on os x with one command
Created September 6, 2018 10:14 — forked from piperswe/ install consolas on os x with one command
Install Consolas on OS X (based on avalonalex/8125197)
Thanks to this Gist: https://gist.github.com/avalonalex/8125197
How to use: Make sure Homebrew is installed then run `curl https://gist.githubusercontent.com/zebMcCorkle/fa4508e27f457d7b796ffd474be35d62/raw/59942466b13fe92d09b4b537cc7fcfb309c05c4a/consolas.sh | bash -`
@xShivan
xShivan / gist:1ff56382949e1d3449dd
Created October 20, 2015 18:56
Problem w ASP.NET 5 Beta 8 na OS X w migracji EF.
Using context 'ApplicationDbContext'.
Using database 'main' on server '/Users/michal/dev/Foobar.Web/Foobar.Web.db'.
System.EntryPointNotFoundException: sqlite3_close_v2
at (wrapper managed-to-native) Microsoft.Data.Sqlite.Interop.NativeMethods:sqlite3_close_v2 (intptr)
at Microsoft.Data.Sqlite.Interop.Sqlite3Handle.ReleaseHandle () in <filename unknown>:line 0
at System.Runtime.InteropServices.SafeHandle.DangerousReleaseInternal (Boolean dispose) in <filename unknown>:line 0
at System.Runtime.InteropServices.SafeHandle.DisposeInternal () in <filename unknown>:line 0
at System.Runtime.InteropServices.SafeHandle.InternalDispose () in <filename unknown>:line 0
at System.Runtime.InteropServices.SafeHandle.Dispose (Boolean disposing) in <filename unknown>:line 0
at System.Runtime.InteropServices.SafeHandle.Dispose () in <filename unknown>:line 0
MAIN MODULE projpsy;
FROM SimMod IMPORT StartSimulation, SimTime, TriggerObj;
FROM IOMod IMPORT ReadKey, StreamObj, ALL FileUseType;
FROM StatMod IMPORT TSINTEGER, SINTEGER, SREAL, RStatObj, IStatObj, ITimedStatObj;
FROM GrpMod IMPORT RankedObj, QueueObj, StackObj;
FROM RandMod IMPORT RandomObj;
TYPE
@xShivan
xShivan / gist:de8f3fe9a3db5b8b0a5e
Created December 29, 2014 12:19
Decoding HTML part of *.eml in Ruby
#!/usr/bin/env ruby
require 'mail'
mail = Mail.read 'inbox/0.eml'
mail.parts.each do |part|
if part.content_type.include? 'text/plain'
puts 'plain part'
elsif part.content_type.include? 'text/html'
puts 'html part'
@xShivan
xShivan / gist:6c395ebd65e3f6f41ac0
Created December 29, 2014 12:18
Mailcheck using POP3 in Ruby
#!/usr/bin/env ruby
require 'net/pop'
Net::POP3.enable_ssl
pop = Net::POP3.new 'pop3.server.com'
pop.start 'email/login', 'pass'
if pop.mails.empty?
puts "No mail."
else
@xShivan
xShivan / gist:4ee5efb80d71a5039ce0
Created December 18, 2014 11:53
Cholesky decomposition
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package choleskydecomposition;
import Jama.*;
/**
@xShivan
xShivan / config.php
Last active August 29, 2015 14:04
Configuration for custom model in CodeIgniter
define('MYSQL_LOCALE', 'localhost'); //Server IP
define('MYSQL_DB', 'databse'); //DB Name
define('MYSQL_USER', 'pro'); //DB Username
define('MYSQL_PASS', 'test'); //DB Password
@xShivan
xShivan / Model.php
Created July 22, 2014 08:39
CodeIgniter model modified to use PDO Library
class CI_Model {
/**
* Constructor
*
* @access public
*/
private $pdo = null;
#include <REGX52.H>
unsigned char xdata Lewy _at_ 0xFE00;
unsigned char xdata Prawy _at_ 0xFD00;
char in, i, j;
char src;
void ISR_Serial(void) interrupt 4
{
if(RI == 1)
#include <REGX52.H>
sbit BUTTON1 = P0^0;
sbit BUTTON2 = P0^1;
char turn;
bit state;
void wait(int input)
{