Skip to content

Instantly share code, notes, and snippets.

View MichaelDimmitt's full-sized avatar
:shipit:
𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫… jobless

MichaelDimmitt

:shipit:
𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫𒐫… jobless
View GitHub Profile
@MichaelDimmitt
MichaelDimmitt / daily-commit.yml
Last active May 27, 2022 15:28
github action to add current date to a temp file with current date as commit message.
name: adds todays date to master branch at 7am eastern time, 11am utc
on:
schedule:
- cron: "0 11 * * *"
# on:
# push:
# branches:
# - master
jobs:
@MichaelDimmitt
MichaelDimmitt / pianobar-usage.md
Last active December 7, 2022 16:11
Keep track of time and listen to music!

Keep track of time and listen to music! 🎉

I want to listen to my music from command line,
but I have a meeting in 20 minutes!

timeout 20m pianobar || reset

^ use this one

With the timeout command you can specify: minutes, hours, days, seconds

@clintonlunn
clintonlunn / helpfulUseEffects.jsx
Created October 8, 2021 17:17
Helpful useEffects Yo
import { useEffect } from 'react';
// ...
const { var1, var2, var3 } = props
useEffect(() => {
console.log('tell me what loaded first time', { var1, var2, var3 })
}, [])
useEffect(() => {
console.log('tell me what changed plz ', { var1, var2, var3 })
})
*** Settings ***
Library SeleniumLibrary
Documentation
... My First Test
... This test will Verify Google
*** Keywords ***
Navigate To Google
@sushant12
sushant12 / .iex.exs
Last active November 7, 2023 17:53
list or search through your iex history
# The bash command `history | grep abc` is a neat tool. I abuse it alot.
# So, I wrote a module that would list or search through iex history.
# https://dev.to/sushant12/list-all-history-in-iex-408b
# I prefer to put this module in my .iex.exs file and then import the .iex.exs file into my project.
defmodule History do
def search do
load_history()
|> Enum.with_index(1)
|> Enum.each(fn {value, index} ->
@themanifold
themanifold / node-prune.sh
Last active October 1, 2022 02:47
Pruning useless node_modules with bash userland tools (find etc)
#!/usr/bin/env bash
find node_modules \( -name '__tests__' -o \
-name 'test' -o \
-name 'tests' -o \
-name 'powered-test' -o \
-name 'docs' -o \
-name 'doc' -o \
-name '.idea' -o \
-name '.vscode' -o \
-name 'website' -o \
@VeraZab
VeraZab / LocalNotifications.js
Last active February 26, 2023 23:26
Simple local notification with Expo
import React, {Component} from 'react';
import {TextInput, View, Keyboard} from 'react-native';
import {Constants, Notifications, Permissions} from 'expo';
export default class Timer extends Component {
onSubmit(e) {
Keyboard.dismiss();
const localNotification = {
title: 'done',
@jgrahamc
jgrahamc / dreamon.c
Created June 26, 2017 19:51
Code from Silicon Valley S03E01
#include <stdio.h>
#include <stdlib.h>
typedef unsigned long u64;
typedef void enc_cfg_t;
typedef int enc_cfg2_t;
typedef __int128_t dcf_t;
enc_cfg_t _ctx_iface(dcf_t s, enc_cfg2_t i) {
@jesperorb
jesperorb / cors.md
Last active February 21, 2024 14:17
Handle CORS Client-side

Handle CORS Client-side

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.

Sources : MDN - HTTP Access Control | Wiki - CORS

CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost. This is primarily set by the header:

Access-Control-Allow-Origin
@michaellihs
michaellihs / tmux-cheat-sheet.md
Last active May 15, 2024 00:33
tmux Cheat Sheet