Skip to content

Instantly share code, notes, and snippets.

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

Amir Ahmic ahmic

🏠
Working from home
  • OLX Group
  • Sarajevo, BA
View GitHub Profile
// ==UserScript==
// @name Maskica Dizajn
// @namespace http://www.webmonkey.com
// @description A Greasemonkey script that finds h2 tags and creates a floating menu of them.
// @include https://www.pinterest.com/
-- change this to yours Instagram username
set userName to "ahmic.jpg"
set jsonData to do shell script "curl -s 'https://www.instagram.com/" & userName & "/?__a=1'"
set AppleScript's text item delimiters to {","}
set keyValueList to (every text item in jsonData) as list
set AppleScript's text item delimiters to ""
set followersItem to item 11 of keyValueList
set followersObject to RemoveFromString("\"", followersItem)
@ahmic
ahmic / laravel_nova_helpers.txt
Created July 23, 2019 23:03
Laravel Nova helpers
// Compile nova assets for development to enable Vue DevTools
cd ./nova (or ./vendor/laravel/nova)
npm i
mv webpack.mix.js.dist webpack.mix.js
npm run dev
cd ../ (or ../../../)
php artisan nova:publish
This file has been truncated, but you can view the full file.
[{"id":58009,"ime":"Zlatko","prezime":"Topčić","email":null,"telefon":null,"institucija":null,"ministarstvo":null,"strucnaSprema":"VSS","nazivRadnogMjesta":"Direktor","nazivOrganaUprave":"JU Biblioteka Sarajeva","osnovnaPlata":1701.0,"datumZasnivanjaRadnogOdnosaNaNeodredjenoVrijeme":null,"datumPrestankaRadnogOdnosaNaNeodredjenoVrijeme":null,"trajanjeUgovoraNaOdredjenoVrijemeOD":null,"trajanjeUgovoraNaOdredjenoVrijemeDO":null,"resornoMinistarstvoOrgana":null,"sjedisteOrgana":"Mis Irbina 4, Sarajevo","napomena":null},{"id":58010,"ime":"Dženana","prezime":"Ahmić","email":null,"telefon":null,"institucija":null,"ministarstvo":null,"strucnaSprema":"VSS","nazivRadnogMjesta":"Bibliotekar - odjeljenje","nazivOrganaUprave":"JU Biblioteka Sarajeva","osnovnaPlata":1165.5,"datumZasnivanjaRadnogOdnosaNaNeodredjenoVrijeme":null,"datumPrestankaRadnogOdnosaNaNeodredjenoVrijeme":null,"trajanjeUgovoraNaOdredjenoVrijemeOD":null,"trajanjeUgovoraNaOdredjenoVrijemeDO":null,"resornoMinistarstvoOrgana":null,"sjedisteOrgana":"Mis Irbi
@ahmic
ahmic / helpers.php
Last active July 23, 2019 23:04
Github user score
<?php
public function calculateScore($username)
{
// Fetch user info from Github API
$url = 'https://api.github.com/users/'.$username.'/events/public';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@ahmic
ahmic / instagram.txt
Last active March 2, 2018 16:39
Touch Bar widgets
set userName to "ahmic.jpg"
set jsonData to do shell script "curl -s 'https://www.instagram.com/" & userName & "/?__a=1'"
set AppleScript's text item delimiters to {","}
set keyValueList to (every text item in jsonData) as list
set AppleScript's text item delimiters to ""
set followersItem to item 7 of keyValueList
set followersObject to RemoveFromString("\"", followersItem)
set followersObject to RemoveFromString("{", followersObject)
set followersObject to RemoveFromString("}", followersObject)