Skip to content

Instantly share code, notes, and snippets.

👮‍♀
git inspector

Andrew Luca iamandrewluca

👮‍♀
git inspector
Block or report user

Report or block iamandrewluca

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@iamandrewluca
iamandrewluca / conio.c
Created Mar 20, 2019
Citeva functii din conio.h create cu ajutorul bibliotecii windows.h
View conio.c
#include <windows.h>
// ShowCursor(true) afiseaza cursorul
// ShowCursor(false) nu afiseaza cursorul
void ShowCursor(bool show)
{
HANDLE hConsoleOutput;
CONSOLE_CURSOR_INFO structCursorInfo;
hConsoleOutput = GetStdHandle( STD_OUTPUT_HANDLE );
GetConsoleCursorInfo( hConsoleOutput, &structCursorInfo );
View time-machine.c
// determinarea timpului de executie a unui program
// sau a oricarei parti din program doriti
// cu ajutorul functiei clock() din biblioteca time.h
// clock() returneaza timpul in milisec de la executarea programului
// returneaza -1 in caz de eroare
#include <time.h> // clock();
#include <windows.h> // Sleep()
#include <stdio.h>
int main()
{
@iamandrewluca
iamandrewluca / number-generate.c
Created Mar 20, 2019
Generarea unui numar intre 2 intervale
View number-generate.c
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
int rnd(int min, int max) {
return min + rand() % (max - min +1);
}
int main() {
srand(time(NULL));
@iamandrewluca
iamandrewluca / ProtectedLink.jsx
Last active Jan 25, 2019
react-router, composition vs inheritance
View ProtectedLink.jsx
@iamandrewluca
iamandrewluca / oss-tools.md
Last active Aug 9, 2019
Open source software tools
@iamandrewluca
iamandrewluca / top-commands.sh
Created Nov 30, 2018
Show top 10 commands most used
View top-commands.sh
history | awk '{print $2}' | sort | uniq -ci | sort -gr | head -n 10
View getModalEvents.js
function getModalEvents(element) {
const targets = [
{ name: 'window', element: window },
{ name: 'document', element: document },
{ name: 'element', element: element }
]
const data = $.data(element)['bs.modal']
if (data && data._dialog) {
@iamandrewluca
iamandrewluca / bootstrap-fluid-example.html
Last active Sep 10, 2018
Bootstrap elements abstraction using fluid
View bootstrap-fluid-example.html
<html xmlns:b="http://typo3.org/ns/BK2K/BootstrapPackage/ViewHelpers">
<b:modal>
<b:modal.header>
Modal title
</b:modal.header>
<b:modal.body>
Modal body text goes here.
</b:modal.body>
<b:modal.footer>
<b:button color="secondary" data-dismiss="modal">Close</b:button>
View attachNestedReducers.js
// an alternative to combineReducers
// attach an reducer to a key in the state
export function attachNestedReducers(original, reducers) {
const nestedReducerKeys = Object.keys(reducers)
return function combination(state, action) {
const nextState = original(state, action)
let hasChanged = false
const nestedState = {}
for (let i = 0; i < nestedReducerKeys.length; i++) {
const key = nestedReducerKeys[i]
@iamandrewluca
iamandrewluca / app.js
Last active Aug 13, 2018
Modal Toggler
View app.js
import React from 'react'
import { MyModal } from 'my-modal'
import { MyModalToggleButton } from 'modal-toggle-button'
const App = () => (
<React.Fragment>
<MyModalToggleButton />
<MyModal />
</React.Fragment>
)
You can’t perform that action at this time.