Skip to content

Instantly share code, notes, and snippets.

@andrijac
andrijac / Test.dart
Created May 22, 2013 13:10
webstorm test
import "dart:html";
void main() {
query("#cont").text = "AAA";
query("#cont").text = "FFF";
query("#cont").text = "FFF";
}
using System;
using System.Collections.Generic;
namespace ConsoleApplication1
{
class Class1
{
static Dictionary<Type, string> GetClrCsharpMapping()
{
return new Dictionary<Type, string>()
@andrijac
andrijac / rename_vine_files.rb
Created June 10, 2013 05:53
Rename your Vine video files, replace ':' to '_' so files are not longer write-protected. I had a problem with uploading to Google+ if files have ':' character in the file name. On Android, use Ruboto. On iPhone, I have no idea how it works, but you will probably need to change path to Vine folder.
puts "Renaming files..."
folder_path = "/storage/sdcard0/DCIM/Vine/" # adjust
new_replace = ':' # adjust
if(!Dir.exists?(folder_path))
abort "folder does not exist!"
end
Dir[folder_path + "*"].each do |f|
@andrijac
andrijac / sybase_uninstall
Created June 26, 2013 05:58
Uninstall Sybase server 12.5
$JAVA_HOME/bin/java -classpath $SYBASE/uninstall/ASESuite/uninstall.jar
-Dtemp.dir=/var/tmp -Dis.jvm.home$JAVA_HOME -Dis.jvm.temp=1
-Dis.launcher.file=$SYBASE/uninstall/ASESuite/uninstall -Xms20m
-Xmx60m run -console
void downloadFileToClient(String filename, String text){
AnchorElement tl = document.createElement('a');
tl..attributes['href'] = 'data:text/plain;charset=utf-8,' + Uri.encodeComponent(text)
..attributes['download'] = filename
..click();
}
/**
* Cross Browser helper to addEventListener.
*
* @param {HTMLElement} obj The Element to attach event to.
* @param {string} evt The event that will trigger the binded function.
* @param {function(event)} fnc The function to bind to the element.
* @return {boolean} true if it was successfuly binded.
*/
var cb_addEventListener = function(obj, evt, fnc) {
// W3C model
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
namespace ConsoleApplication15
{
// test, 2 parameters: "string pstrJobid, string pstrMode, string pstrPath, string pstrName, byte[] pstrFiledata, bool pbOverwrite, string pstrTag, bool pbFinal" "pstrJobid, pstrMode, pstrPath, pstrName, pstrFiledata, pbOverwrite, pstrTag, pbFinal"
internal class Program
{
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApplication16
{
internal class Program
{
private static Action<object> wl = (num) => Console.WriteLine(num.ToString());
private static Action<string> wl = (s) => Console.WriteLine(s);
private static Dictionary<string, string> GetParameters(string[] args)
{
Debug.Assert(args.Length % 2 == 0, "Arguments have to be in key/value pars. Collection has to have even numbers");
Dictionary<string, string> values = new Dictionary<string, string>();
string key = string.Empty;
string value = string.Empty;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Principal;
namespace CopyFilesTest
{