Skip to content

Instantly share code, notes, and snippets.

View Alxandr's full-sized avatar
⁉️
⁉️

Aleksander Heintz Alxandr

⁉️
⁉️
View GitHub Profile
@Alxandr
Alxandr / jquery.ui.pagination.js
Created February 2, 2011 20:53
Pagination using jquery ui
/*
* jQuery UI Pagination 0.1.0
*
* By Alxandr
*/
(function( $, undefined ) {
var getAllElements = function(elem, excludeFirst) {
var elm = elem.get(0);
if(elm.tagName.toLowerCase() == 'table') {
@Alxandr
Alxandr / CommandConnection.cs
Created August 24, 2011 11:22
A small framework for creating proxy-classes and send data using XML to and from server/client.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Xml;
using NirQ.Common.Proxy;
using System.Net;
using System.Diagnostics;
@Alxandr
Alxandr / count_lines.sh
Last active October 5, 2015 19:47
A short shell-script that is used to count lines of files given one or more file-sufixes.
#!/bin/bash
#Example use: count_files.sh cs xml // counts lines in *.cs and *.xml recursivly.
set -e
FILES="$@"
for f in $FILES; do
echo -ne "*.$f "
@Alxandr
Alxandr / gist:2947323
Created June 18, 2012 07:42
Removing all internal links from a html-string
/* arbitrary regex replace method. Can be php preg_replace or something like that */
RegexReplace("<a [^>]*href=\"#[^\">]*\"[^>]*?>(.*?)</a[^>]*?>", "$1")
@Alxandr
Alxandr / gist:2959847
Created June 20, 2012 13:19
Context-changes
public class BarCodeUploaderApplet extends Applet {
final String fileName = "C:\\A\\b.dat";
final String backFileName = "C:\\A\\b.old.dat";
public Boolean fileExists() {
final Result<Boolean> result = new Result<>(false);
final JSObject win = (JSObject) JSObject.getWindow(this);
run(new Runnable() {
@Override
@Alxandr
Alxandr / index.html
Created June 27, 2012 06:03
Filemanager mods
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>File Manager</title>
<link rel="stylesheet" type="text/css" href="styles/reset.css" />
<link rel="stylesheet" type="text/css" href="scripts/jquery.filetree/jqueryFileTree.css" />
<link rel="stylesheet" type="text/css" href="scripts/jquery.contextmenu/jquery.contextMenu-1.01.css" />
<link rel="stylesheet" type="text/css" href="styles/filemanager.css" />
<!--[if IE]>
@Alxandr
Alxandr / gist:3001946
Created June 27, 2012 06:28
Showing dates in Filemanager
// Converts UNIX timestamps to dates.
var formatDate = function(date){
function add0(n, l) {
var str = n.toString();
while(str.length < l)
str = 0 + str;
return str;
}
var n = parseInt(date);
var d = new Date(n * 1000);
@Alxandr
Alxandr / filemanager.config.js
Created June 27, 2012 06:41
Filemanager mods complete (more or less)
// Custom settings
//-----------------------------------------
var skipFileInfo = true;
var selectOnUpload = true;
var useRelativePaths = true;
@Alxandr
Alxandr / DisplayStack.cs
Created July 2, 2012 16:44
Helper for displaystack in ios
using System;
using MonoTouch.UIKit;
using System.Collections.Generic;
using FdvWeb.Core;
namespace FdvWeb
{
public class DisplayStack
{
readonly UITabBarController root;
using System;
using MonoTouch.UIKit;
using com.google.zxing;
using MonoTouch.AVFoundation;
using MonoTouch.CoreFoundation;
using MonoTouch.CoreVideo;
using System.Collections;
using MonoTouch.CoreMedia;
using System.Runtime.InteropServices;
using com.google.zxing.common;