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 / 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) {
@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
@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 / 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 / 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 / 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 / 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 / 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 / keybase.md
Created July 14, 2014 19:32
keybase.md

Keybase proof

I hereby claim:

  • I am fitsum on github.
  • I am fitsum (https://keybase.io/fitsum) on keybase.
  • I have a public key whose fingerprint is 4BD8 4239 0E39 19EC 98A3 2C3C AB54 C36F 9A94 8A70

To claim this, I am signing this object:

@fitsum
fitsum / PHP menu maker
Created June 12, 2014 15:33
Lists files & directories recursively
// lists files & directories recursively
<?
function menu($dir){
$files = glob($dir.'/*');
$html = '<ul>';
foreach($files as $file){
if(is_dir($file)){
// FB 6/12
// added bc it wasn't tharr