Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
@cicorias
cicorias / action.js
Created October 13, 2017 00:57 — forked from benpickles/action.js
Inject an Authorization header into a redux-api-middleware request with a Redux middleware.
import { CALL_API } from 'redux-api-middleware'
export function fetchLocations() {
return {
[CALL_API]: {
endpoint: 'http://api.somesite.com/api/locations',
method: 'GET',
// Don't have to manually add the Authorization header to every request.
headers: { 'Content-Type': 'application/json' },
types: ['REQUEST', 'SUCCESS', 'FAILURE']
@cicorias
cicorias / README.md
Created November 23, 2017 02:15 — forked from jonathantneal/README.md
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@cicorias
cicorias / Synology-Diskstation-Git.md
Created December 4, 2017 02:45 — forked from walkerjeffd/Synology-Diskstation-Git.md
Instructions for setting up git server on Synology Diskstation

Configure Synology NAS as Git Server

Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.

Set Up User and Folder

  • Create user gituser via Diskstation interface (with File Station and WebDAV privilages)
  • Add new shared folder called git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.
  • Install Git Server package via Diskstation
@cicorias
cicorias / App.js
Created December 6, 2017 14:17 — forked from fdidron/App.js
React Router v4 Auth
//Usage
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Route from './AuthRoute';
import Login from './Login';
import Private from './Private';
export default () =>
<Router>
@cicorias
cicorias / spectre.c
Created January 4, 2018 01:32 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@cicorias
cicorias / get_coursera_videos.sh
Created January 15, 2018 04:13
Download Coursera Videos
git clone https://github.com/coursera-dl/coursera-dl
cd coursera-dl
pip3 install -r requirements.txt
./coursera-dl -u <Email-id> -p <Password> --subtitle-language en raspberry-pi-interface
@cicorias
cicorias / k8s-pi.md
Created February 17, 2018 18:48 — forked from alexellis/k8s-pi.md
K8s on Raspbian

K8s on (vanilla) Raspbian Lite

Yes - you can create a Kubernetes cluster with Raspberry Pis with the default operating system Raspbian. Carry on using all the tools and packages you're used to with the officially-supported OS.

Pre-reqs:

  • You must use an RPi2 or 3 for Kubernetes
  • I'm assuming you're using wired ethernet (Wi-Fi also works)

Master node setup

@cicorias
cicorias / confirm.html
Created March 4, 2018 17:22 — forked from phsamuel/confirm.html
A simple "voting" example with node.js
<html>
<body>
<H2>Are you sure to overwrite your votes?</H2>
<form action="" method="post" enctype="multipart/form-data">
<fieldset>
<input type="submit" name="action" value="Update" />
<input type="submit" name="action" value="Cancel" />
</fieldset>
</form>
</body>
@cicorias
cicorias / settings.json
Last active April 29, 2018 16:37 — forked from SunnyJohal/settings.json
My VS Code Settings
{
"auto-close-tag.fullMode": true,
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
"emmet.syntaxProfiles": {
"javascript": "jsx"
},
"editor.tabSize": 2,
"workbench.activityBar.visible": false,
@cicorias
cicorias / parallels_tools_ubuntu_new_kernel_fix.md
Created May 22, 2018 18:39 — forked from rudolfratusinski/parallels_tools_ubuntu_new_kernel_fix.md
Parallels Tools fix for Ubuntu 18.04 and other Linux distributions with Kernel version >= 4.15

Preparation

  • In open Ubuntu 18.04 machine click Parallels Actions -> "Install Parallels Tools"

  • A "Parallels Tools" CD will popup on your Ubuntu desktop.

  • Open it by double mouse click, copy all the content to a new, empty directory on a desktop, name it for e.g. "parallels_fixed"

  • Open terminal, change directory to parallels_fixed (cd ~/Desktop/parallels_fixed)

  • Make command line installer executable (chmod +x install)

  • Change directory to "installer" (cd installer)

  • Make few other scripts executable: chmod +x installer.* *.sh prl_*