Skip to content

Instantly share code, notes, and snippets.

@P4
P4 / .bashrc
Last active October 13, 2015 08:08
.bashrc: custom prompt, aliases
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Handy aliases
alias diff='~/bin/diff.py'
alias documents='cd /d/Dokumenty/'
@P4
P4 / default.reg
Last active April 13, 2024 05:23
Color schemes for Windows Command Prompt
Windows Registry Editor Version 5.00
; Default color scheme
; for Windows command prompt.
; Values stored as 00-BB-GG-RR
[HKEY_CURRENT_USER\Console]
; BLACK DGRAY
"ColorTable00"=dword:00000000
"ColorTable08"=dword:00808080
; BLUE LBLUE
@P4
P4 / foreach.py
Last active December 14, 2015 17:59
Re-implement Python's for statement using @decorator syntax
#! /usr/bin/python
def foreach(iterable):
def iterate_over(func):
iterator = iter(iterable)
while True:
try:
value=next(iterator)
func(value)
; Pawel Maniecki
; Asemblery, IET AGH
.186 ; pusha, popa
_Dane segment
; Argumenty
argc db 0 ; ilosc argumentow ( dlugosc args )
args dw 10h dup(?) ; offsety na poczatki argumentow w argv
@P4
P4 / RLE.asm
Last active August 29, 2015 14:01
Implementacja Run-Length-Encoding (RLE)
; Pawel Maniecki
; Asemblery, IET AGH
.186 ; pusha, popa
BUFSIZE = 4000h ; rozmiar bufora: 4*16*256 = 16*1024 = 16 KiB
_Dane segment
; Argumenty linii komend
argc db 0 ; ilosc argumentow ( dlugosc args )
@P4
P4 / Koch.asm
Last active August 29, 2015 14:02
Rysowanie krzywej Kocha: Generowanie przez LSystem, grafika żółwia
; Pawel Maniecki
; Asemblery, IET AGH
; Zadanie 3: Rysowanie krzywej Kocha
; Maksymalna liczba iteracji dla L-systemu: 6
; Maksymalna dlugosc odcinka: 100px
ITERMAX equ 6 ; Maksymalna ilosc iteracji ( nie wieksza od 6 )
; Dlugosc napisu opisujacego krzywa Kocha dla n iteracji dana jest wzorem
; K(n) = 7 * 4^n
module tester (
//wejscia kontrolne
input clk,
input reset_n,
//interfejs do debugowania
output [1:0] dbg_state,
output [3:0] dbg_r0,
output [3:0] dbg_r1,
output [3:0] dbg_pc
@P4
P4 / main-template.c
Last active August 29, 2015 14:23
FreeRTOS
#include <stdio.h>
/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"
/* Library includes. */
#include "stm32f10x.h"
@P4
P4 / CustomLeafletMarkers.ts
Created September 7, 2016 20:49
Testing extending Leaflet components via TypeScript's inheritance model
/// <reference path='../leaflet/leaflet.d.ts' />
namespace L {
type LatLngExpression = L.LatLng | number[] | ({ lat: number; lng: number });
export var JSMarker = L.Marker.extend({
options: { title: 'MyMarker' },
initialize: function(latLng: LatLngExpression, options?: L.MarkerOptions) {
@P4
P4 / create_sde_connection.py
Created October 5, 2016 22:14 — forked from odoe/create_sde_connection.py
Arcpy script to add data to mxd and publish to ArcGIS server without ArcMap
'''
Created on Feb 24, 2011
The purpose of this script is to create the SDE connection file needed to connect to your SDE
@author: rrubalcava
'''
import os, arcpy
class CreateSDEConnection: