Skip to content

Instantly share code, notes, and snippets.

View fitsum's full-sized avatar
💭
npx fitsum

ፍፁም fitsum

💭
npx fitsum
View GitHub Profile
@fitsum
fitsum / cmd.php
Last active April 26, 2024 05:12
executes on shell commands via browser + TODOs
<!DOCTYPE html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>CMD</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
/* Eric Meyer's Reset CSS v2.0 - http://cssreset.com */
@fitsum
fitsum / html5_mvp.sublime-snippet
Last active April 26, 2024 05:12
sublime snippet for mvp
<snippet>
<content><![CDATA[<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
@fitsum
fitsum / html5_bootstrap.sublime-snippet
Created December 15, 2014 17:58
sublime snippet for bootstrap/MVP
<snippet>
<content><![CDATA[<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"/>
@fitsum
fitsum / gulpfile
Created January 22, 2015 17:28
basic gulp w/ gulp-connect
var gulp = require('gulp'),
connect= require('gulp-connect');
gulp.task('connect',function(){
connect.server({
root: './',
livereload: true,
port: 9999
});
@fitsum
fitsum / app boiler
Created February 27, 2015 22:06
app boiler
APP BOILER
Entry Points
Time
check local storage (last || total visit(s)),
check server/appstorage (last || total visit(s))
check TOD
check DOW (work/school)
check MOY (season general, available activities)
@fitsum
fitsum / fullscreen toggle
Created April 21, 2015 04:18
cross-device, modified to launch on click and only cancel on drag from top instead of toggling on click
function toggleFullScreen() {
var doc = window.document;
var docEl = doc.documentElement;
var requestFullScreen = docEl.requestFullscreen || docEl.mozRequestFullScreen || docEl.webkitRequestFullScreen || docEl.msRequestFullscreen;
var cancelFullScreen = doc.exitFullscreen || doc.mozCancelFullScreen || doc.webkitExitFullscreen || doc.msExitFullscreen;
// if(!doc.fullscreenElement && !doc.mozFullScreenElement && !doc.webkitFullscreenElement && !doc.msFullscreenElement) {
requestFullScreen.call(docEl);
// }
@fitsum
fitsum / git lgs
Created June 8, 2015 22:27
pretty git logs
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
@fitsum
fitsum / gitscripts
Last active April 26, 2024 05:11
🙏🔧 so far just the one
# more to come
#!/bin/bash
#!/bin/bash
function reba(){
#first arg is rebase branch
count=1
for branch in "$@"
do
arguments.callee.caller.toString()
@fitsum
fitsum / if(array.indexOf(someObj) === -1) {add} else {next}
Last active April 26, 2024 05:02
check if obj exists in array then add if not
var source = [{name: "Fitsum", race: "blk"},{name: "Alice", race: "wht"},{name: "Jen", race: "wht"},{name: "Kim", race: "blk"},{name: "Lee", race: "asn"}],
target = [];
function userExists(name, idx, oldArr) {
return target.some(function(el) {
return el.name === name;
});
}
function addUser(name, idx, newArr) {