Skip to content

Instantly share code, notes, and snippets.

View ivpusic's full-sized avatar
👨‍💻

Ivan Pusic ivpusic

👨‍💻
View GitHub Profile
@ivpusic
ivpusic / Zadatak_2_ivpusic
Created November 13, 2010 00:26
StrukturePodataka
// Datoteka zaglavlja stog_polje.h
struct tauto{
int sb, godina;
char proizvodac[20], model[20];
};
struct stog {
tauto automobil[51];
@ivpusic
ivpusic / Emacs - jump to the closing html tag
Created October 7, 2012 20:36
Emacs - jump to the closing html tag
Ctrl+c Ctrl+f (sgml-skip-tag-forward)
Ctrl+c Ctrl+b (sgml-skip-tag-backward)
/* ----------Zadatak 1---------- */
osoba[
ime => string,
prezime => string,
placa => integer,
ukupne_place => integer
].
?osoba[ukupne_place -> ?ukupna_placa]:-
?ukupna_placa = sum{?_place | ?_:?osoba[placa -> ?_place]}.
% Duplicate elements in list %
dupl([], []).
dupl([G | R], [G | [G | Res]]):-
dupl(R, Res).
% --------------------------- %
% Duplicate n times elements in list %
# case 1
cdef:
ffi_type *f_type
ffi_type* elements[3]
if (some condition......):
some code........
else:
# THIS WORKS #
f_type.size = 0
import ctypes
class Point(ctypes.Structure):
_fields_ = (
("x", ctypes.c_int),
("y", ctypes.c_int))
p1 = Point(23, 4)
print 'Original point is', (p1.x, p1.y)
// Facebook SDK
angular.module('facebook', [])
.directive('fb', ['$FB', function($FB) {
return {
restrict: "E",
replace: true,
template: "<div id='fb-root'></div>",
compile: function(tElem, tAttrs) {
return {
post: function(scope, iElem, iAttrs, controller) {
[DEBUG] --------------------------------------------------------------------------------
[DEBUG] call_instance_method() setSELValues: 0x1005dfa38 0x1008a6e00
[DEBUG] --------------------------------------------------------------------------------
[DEBUG] signature ensure_method --> setSELValues: ('v', '24', None)
[DEBUG] pre-zip signature: [('@', '0', None), (':', '8', None), ('[', '10', None), (':]', '16', None)]
[DEBUG] array signature zip: [('@', '0', None), (':', '8', None), ('[10:]', '16', None)]
[DEBUG] input for type_encoding_to_ffitype(type_encoding=v, str_in_union=False)
[DEBUG] argument ==> ('@', '0', None) 3
[DEBUG] input for type_encoding_to_ffitype(type_encoding=@, str_in_union=False)
[DEBUG] argument ==> (':', '8', None) 3
globals({'_NSRange': <class 'pyobjus.objc_py_types.NSRange'>, 'CGPoint': <class 'pyobjus.objc_py_types.NSPoint'>, 'letters': 'abcdefghijklmnopqrstuvwxyz', 'NSRange': <class 'pyobjus.objc_py_types.NSRange'>, 'testUn': <class 'pyobjus.objc_py_types.testUn'>, 'Factory': <class 'pyobjus.objc_py_types.Factory'>, 'NSPoint': <class 'pyobjus.objc_py_types.NSPoint'>, 'CGSize': <class 'pyobjus.objc_py_types.NSSize'>, '__package__': 'pyobjus', 'NSSize': <class 'pyobjus.objc_py_types.NSSize'>, 'NSComparisonResult': <class 'pyobjus.objc_py_types.NSComparisonResult'>, 'CFRange': <class 'pyobjus.objc_py_types.NSRange'>, 'signature_types_to_list': <built-in function signature_types_to_list>, '__doc__': None, 'CGRect': <class 'pyobjus.objc_py_types.NSRect'>, 'NSStringEncoding': <class 'pyobjus.objc_py_types.NSStringEncoding'>, 'test_un_': <class 'pyobjus.objc_py_types.test_un_'>, '__builtins__': {'bytearray': <type 'bytearray'>, 'IndexError': <type 'exceptions.IndexError'>, 'all': <built-in function all>, 'help': Type help()
@ivpusic
ivpusic / gist:f84b84ee4654b29c2112
Created May 28, 2014 15:58
small config for sublime ctags
// Place your settings in the file "User/CTags.sublime-settings", which
// overrides the settings in here.
{
// Enable debugging
"debug": false,
// Enable autocomplete
"autocomplete": true,
// Set to false to disable recursive search for ctag generation. This