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 / sass-cheatsheet.md
Last active November 6, 2024 17:48
A high-level Sass (SCSS) cheatsheet for the most important functionality features of Sass.
/*!
* Font Awesome Free 5.10.1 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
.fa,.fab,.fad,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-p
@fredsiika
fredsiika / npm ignore-scripts
Created April 23, 2020 16:37
npm command to prevent delayed running of malicious npm packages.
npm config set ignore-scripts true
@fredsiika
fredsiika / find-user.sh
Last active June 11, 2019 21:49
A simple shell script to locate username.
#!/bin/bash
# find-user.sh: A simple shell script to locate username.
# Author: Fred C. Siika
# GitHub: https://github.com/fredsiika
# Modify this script for your own purposes.
################################################################
# Goals of the script:
# How Do I Store Exit Status Of The Command In a Shell Variable?
# Assign $? to a shell variable:
@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);
@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 / 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 / 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 / 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 / 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