This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void say_msg(char msg[]); | |
int main(void) { | |
char str[] = "C is a butt-kicking programming language.\n"; | |
say_msg(str); | |
printf("%ld\n", sizeof(str)); // 43. WTF?! | |
printf("%ld\n", sizeof(&str)); // 8 or 4. Why? Isn't str already a pointer variable. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:function! SwapArgs() | |
. subst :(\zs\([^,]\+\), \([^)]\+\):\2, \1 | |
endfunction | |
" :call SwapArgs() | |
" nnoremap <Leader>sa :call SwapArgs()<CR> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unset HISTFILESIZE | |
HISTSIZE=2000 | |
PROMPT_COMMAND="${PROMPT_COMMAND:-:}; history -a" | |
export HISTSIZE PROMPT_COMMAND | |
# If this is an xterm set the title to user@host:dir | |
case "$TERM" in | |
xterm*|rxvt*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var pg = require('pg'); | |
var constr = 'postgres://devel:1234@127.0.0.1/tcc'; | |
var server = http.createServer(function(req, res) { | |
pg.connect(constr, function(err, client, done) { | |
var handleError = function(err) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
orig=tmp.c | |
dest=./bin/tmp.bin | |
SDL_FLAGS := $(shell sdl-config --cflags) | |
SDL_LDFLAGS := $(shell sdl-config --libs); | |
build: | |
gcc $(orig) -o $(dest) -std=c99 -Wall -pedantic $(SDL_FLAGS) $(SDL_LDFLAGS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Vector | |
{ | |
public: | |
float x, y; | |
}; | |
class Point | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -wU | |
# | |
# Source: | |
# | |
# http://asciidoctor.org/docs/editing-asciidoc-with-live-preview/#using-bundler | |
# | |
Bundler.require(:default) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var l = function l() { | |
console.log.apply(console, arguments); | |
}; | |
var itemsDb = null; | |
// Ionic Starter App | |
// angular.module is a global place for creating, registering and retrieving Angular modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for @user_category do |f| %> | |
<p> | |
<%= f.label :description %> | |
<%= f.text_field :description %> | |
</p> | |
<p> | |
<%= f.radio_button :status, true, :id => 'status_true' %> | |
<%= f.label 'Ativo', :for => 'status_true' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- I have the tables `category`, `subscription` and `document`. Document | |
-- references subscription, and subscription references category. I am trying to | |
-- get the category name based on a documents PK. I am doing something like this: | |
SELECT category_name FROM categorias | |
INNER JOIN subscription ON category_fk = category_pk | |
INNER JOIN documents ON subscription_fk = document_pk | |
AND document_pk = 14; |
OlderNewer