Skip to content

Instantly share code, notes, and snippets.

Avatar

Almir Sarajčić almirsarajcic

View GitHub Profile
@almirsarajcic
almirsarajcic / github-branches-removal.js
Created Mar 13, 2017
Remove branches from the GitHub repo
View github-branches-removal.js
var preservedBranches = [
'master', 'develop'
];
// Remove branches on the current page
var branches = document.getElementsByClassName('branch-summary');
for (var i = 0; i < branches.length; i++) {
var branchName = branches[i].dataset.branchName;
View klix_krizaljka_cheat.js
var KrizaljkaCtrl = angular.element('.krizaljka').scope();
KrizaljkaCtrl.switchAutoProvjera();
for (i = 0; i < KrizaljkaCtrl.krizaljka.odgovori.length; i++) {
var hash = KrizaljkaCtrl.krizaljka.odgovori[i];
if (hash.tip == 'odgovor' || hash.tip == 'istaknutiodgovor') {
hash.inputValue = hash.val;
$('.kockica[x="' + hash.coords.x + '"][y="' + hash.coords.y + '"] input')
View got_rhythm_cheat.js
var interval = 500.5,
container = $('#container'),
score = $('#score'),
lastScore = 0,
addend = -1,
clickCount = 0,
clickLimit = 40,
playButton = $('#play'),
restartButton = $('.restart');
@almirsarajcic
almirsarajcic / determine_playerslot.php
Last active Dec 14, 2015
Function returns decimal player slot for $player_slot returned by DOTA2 WebAPI. $player_slot∈(0, 4)∪(128, 132) result∈(0, 9)
View determine_playerslot.php
<?php
function determine_playerslot($player_slot)
{
$binary = sprintf('%08b', $player_slot);
$team = substr($binary, 0, 1);
$slot = bindec(substr($binary, 1));
return $team * 5 + $slot;
}
@almirsarajcic
almirsarajcic / steamid_conversion.php
Last active Oct 20, 2020
Functions used to convert 64bit Steam ID to 32bit and the other way around.
View steamid_conversion.php
<?php
function convert_steamid_64bit_to_32bit($id)
{
$result = substr($id, 3) - 61197960265728;
return (string) $result;
}
function convert_steamid_32bit_to_64bit($id)
{
View login.html
<form action="/forum/ucp.php?mode=login" method="post">
<input type="text" name="username" size="18" placeholder="Username">
<input type="password" name="password" size="18" placeholder="Password">
<input type="checkbox" name="remember" value="yes" checked="">
<input type="hidden" name="autologin" value="on">
<input type="hidden" name="redirect" value="/">
<button value="Log in" name="login" type="submit">Log in</button>
<a href="/forum/ucp.php?mode=sendpassword">Forgotten password?</a>
<a href="/forum/ucp.php?mode=register">Register</a>
</form>
You can’t perform that action at this time.