Skip to content

Instantly share code, notes, and snippets.

View drkameleon's full-sized avatar
🏠
Working from home

Yanis Zafirópulos drkameleon

🏠
Working from home
View GitHub Profile
@drkameleon
drkameleon / PPTerminal.m
Created October 4, 2014 07:35
Pseudo-asynchronous Block-based Objective-C -> PHP/Python/Ruby Bridge
//
// PPTerminal.m
//
// Created by Dr.Kameleon on 9/28/14.
// Copyright (c) 2011-2014 InSili.co. All rights reserved.
//
//-----------------------------------------------------------
// Pseudo-asynchronous Block-based
// Objective-C -> PHP/Python/Ruby Bridge
//
@drkameleon
drkameleon / debug.sh
Last active August 29, 2015 14:07
Compile and Debug Cocoa/Objective-C from Terminal
# Compile/Run/Debug Script
# For Objective-C/Cocoa Xcode projects
#
# Copyright (c) 2014
# Dr.Kameleon
# Usage:
# ./debug.sh PROJECT <DESTINATION>
project=$1
@drkameleon
drkameleon / htmlobf.php
Created October 19, 2014 08:45
HTML::Obfuscator
#!/usr/bin/env php
<?php
/*********************************************
HTML::Obfuscator
For PHP
Copyright (c) 2014, Dr.Kameleon
*********************************************
Requirements:
node packer module
@drkameleon
drkameleon / autounfollow.js
Created August 24, 2015 10:47
Automatically Unfollow those who are not following back
// To be copy-pasted in the "Following" Twitter page
var profiles = $(".ProfileCard.js-actionable-user");
for (var i=0; i<profiles.length; i++) {
var p = profiles[i];
var status = $($(p).find(".FollowStatus")[0]).text().trim();
var button = $(p).find(".user-actions-follow-button");
if (status!="follows you") $(button).trigger('click');
}
@drkameleon
drkameleon / bootstrap.less
Created May 12, 2013 09:23
My Bootstrap.less file (an ordinary customized-Bootstrap css file, with the .less extension)
/*!
* Bootstrap v2.3.1
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/.clearfix {
*zoom: 1;
@drkameleon
drkameleon / bf2.art
Created October 21, 2020 10:16
BF to Arturo transpiler
memSize: 100
interpret: function [code][
m: map 0..memSize []->0
p: 0
continue: true
replace 'code "," "set m p input ------ "
replace 'code ">" "inc 'p "
replace 'code "<" "dec 'p "
replace 'code "+" "set m p (get m p)+1 "
@drkameleon
drkameleon / bf1.art
Created October 21, 2020 10:20
BF interpreter in Arturo
print ---
=========================
Brainf*ck compiler
In Arturo
=========================
---
tape: [0]
jumps: #[]
dataPointer: 0
@drkameleon
drkameleon / testdicts.art
Created October 28, 2022 16:19
Create 120k+ dictionaries
This file has been truncated, but you can view the full file.
a: #[name: "John", surname: "Doe"]
b: #[name: "Jane", surname: "Doe", address: #[country: "Spain", city: "Madrid"]]
c: #[name: "Bill", age: 36]
a: #[name: "John", surname: "Doe"]
b: #[name: "Jane", surname: "Doe", address: #[country: "Spain", city: "Madrid"]]
c: #[name: "Bill", age: 36]
a: #[name: "John", surname: "Doe"]
b: #[name: "Jane", surname: "Doe", address: #[country: "Spain", city: "Madrid"]]
c: #[name: "Bill", age: 36]
a: #[name: "John", surname: "Doe"]
@drkameleon
drkameleon / rc-tasks.art
Last active December 2, 2022 17:32
RC Tasks (@RickBarretto) in Arturo
RC: "https://rosettacode.org"
GreenLine: color #green repeat "=" 50
sanitizeUrl: function [url]-> replace replace url "pagefrom=" "" "%27" "'"
filterLines: function [lines, pattern]-> select lines 'line [contains? line pattern]
getNextPageUrl: function [lines][
loop filterLines lines {next page</a>} 'line [
return sanitizeUrl first match line {/pagefrom=(.+)#mw-pages/}
]
@drkameleon
drkameleon / testsorting.art
Created January 10, 2023 16:33
Test sorting (in effect, test that sorting a Block and a Dictionary yields the same results; either in terms of the expected keys, or values)
labels: ["a", "b", "c", "d", "e", "f", "g", "h"]
items: ["uno", "dos", "tres", "Uno", "perversión", "ábaco", "abismo", "aberración"]
dic: function []-> #.raw flatten @[couple labels items]
revdic: function []-> #.raw flatten @[couple items labels]
verify: function [what][
toDo: [sort] ++ what
bl: do toDo ++ [items]