Skip to content

Instantly share code, notes, and snippets.

@sirwolfgang
sirwolfgang / assert.h
Created March 3, 2013 03:51
Custom Asserts
#include <cstdlib>
#undef assert
#ifndef PLATFORM_DEBUG
#define assert(_bCondition)\
do\
{\
(void)sizeof(_bCondition);\
}\
@sirwolfgang
sirwolfgang / cstr.c
Last active October 8, 2015 09:18
Char* String To Lower Case
char* strlow(char* _str)
{
for(unsigned int c = 0; _str[c]; _str[c++] = tolower(_str[c]));
return _str;
}
@sirwolfgang
sirwolfgang / Gemfile
Last active August 29, 2015 14:23
Rails Default Gems
source 'https://rubygems.org'
gem 'rails', '4.2.0'
gem 'puma'
# databases
gem 'pg'
# javascript Backend
gem 'jbuilder'
@sirwolfgang
sirwolfgang / Gemfile
Last active August 29, 2015 14:23
API with Rails
gem 'jbuilder'
gem 'rack-cors'
@sirwolfgang
sirwolfgang / private.xml
Created February 26, 2015 16:22
Karabiner OSX
<?xml version="1.0"?>
<root>
<windownamedef>
<name>CODIO_IDE</name>
<regex>Codio IDE</regex>
</windownamedef>
<item>
<name>Command_L to Control_L</name>
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE application_name LIKE 'sidekiq%';
{{#if user}}
<%= link_to '{{ user.name }}', "{{ user.profile_path }}" %>
{{else}}
<%= link_to 'Login', new_session_path %> | <%= link_to 'Sign Up', new_user_path %>
{{/if}}
git config --global url."https://".insteadOf git://
@sirwolfgang
sirwolfgang / httpd.sh
Created December 12, 2014 15:44
Ruby Web Server
ruby -run -e httpd . -p 5000
# /etc/postfix/main.cf
myhostname = mail.domain.com
mydomain = domain.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.0.0/24, 127.0.0.0/8
relay_domains =
virtual_alias_domains = domain.com
virtual_alias_maps = hash:/etc/postfix/virtual