Skip to content

Instantly share code, notes, and snippets.

View iamandrewluca's full-sized avatar
🚨
Git Inspector

Andrei Luca iamandrewluca

🚨
Git Inspector
View GitHub Profile
@iamandrewluca
iamandrewluca / tmdwatcherspy.js
Last active September 30, 2015 07:19
highlights topics in red where you wrote something and where is more than one reply after yours
// ==UserScript==
// @name TMD Watcher Spy
// @namespace http://your.homepage/
// @version 0.1
// @description highlights topics in red where you wrote something and where is more than one reply after yours
// @author Luca Andrei
// @include http*://torrentsmd.*/watcher.php
// @include http*://torrentsmd.*/forum.php?action=viewtopic&topicid=*
// @include http*://*.torrentsmd.*/watcher.php
// @include http*://*.torrentsmd.*/forum.php?action=viewtopic&topicid=*
@iamandrewluca
iamandrewluca / divizori.cpp
Created December 4, 2015 17:23
Intr-un masiv de aflat cantitatea si media aritmetica a elementelor divizibile cu 3
#include <iostream>
int main() {
int dimensiuneMasiv;
int *masiv;
float mediaAritmetica;
int numarulElementelorDivizibile = 0;
int sumaElementelorDivizibile = 0;
int divizor = 3;
@iamandrewluca
iamandrewluca / radaciniPatrate.cpp
Created December 4, 2015 17:35
Suma radacinilor patrate a elementelor impare
#include <iostream>
#include <cmath>
int main() {
int dimensiuneMasiv;
int *masiv;
int suma = 0;
std::cout << "Dati numarul de elemente in masiv: ";
@iamandrewluca
iamandrewluca / programming-language-expert-system.pro
Created December 18, 2015 07:07
Expert system for advising a programming language. (GNU Prolog)
% ------------------------------------------------------------------------------
% Generic Expert System interface
% ------------------------------------------------------------------------------
% Dynamic fact
% --------------------------------------
:- dynamic(known/3).
% --------------------------------------
% Start system
% --------------------------------------
solve :-
@iamandrewluca
iamandrewluca / rotire_patrat.cpp
Created February 20, 2016 12:58
Rotirea unui patrat fata de un punct
#include <iostream>
#define PI 3.14
struct Punct
{
float x;
float y;
};
int main(int argc, char const *argv[])
@iamandrewluca
iamandrewluca / chuck.cpp
Created March 24, 2016 17:13
Chuck Norris Binnary
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <bitset>
using namespace std;
/**
* Auto-generated code below aims at helping you parse
@iamandrewluca
iamandrewluca / chuck1.cpp
Created March 24, 2016 17:38
Chuck binnary 1
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <bitset>
using namespace std;
/**
* Auto-generated code below aims at helping you parse
@iamandrewluca
iamandrewluca / MyModel.php
Last active June 17, 2022 12:34
typo3 extbase categories
<?php
/**
* categories
*
* \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category>
* @lazy
*/
protected $categories;
/**
* MyModel constructor.
@iamandrewluca
iamandrewluca / MyController.php
Last active July 3, 2019 09:20
Typo3 / Extbase backend / frontend user manual login
<?php
class MyController extends ActionController
{
// ...
/**
* @var \TYPO3\CMS\Extbase\Mvc\View\JsonView
*/
protected $view;
@iamandrewluca
iamandrewluca / generate-password.js
Last active April 3, 2023 16:21
Generate a password in browser #bookmarklet
javascript: void((function() {
/* More bookmarklets at https://gist.github.com/iamandrewluca/61feacf07bc4f2f50e70f986c2e9b2d2 */
const upAlpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
const lowAlpha = 'abcdefghijklmnopqrstuvwxyz';
const digits = '0123456789';
const specialChars = '!@#$.+';
const defaultSettings = confirm('Default settings');
const includeUpAlpha = defaultSettings ? true : confirm('Include: ' + upAlpha + ' ?');
const includeLowAlpha = defaultSettings ? true : confirm('Include: ' + lowAlpha + ' ?');