Skip to content

Instantly share code, notes, and snippets.

View sam016's full-sized avatar
🎯
Focusing

sam016

🎯
Focusing
View GitHub Profile
@sam016
sam016 / font.theme.sh
Last active December 5, 2021 10:20
oh-my-bash's `Font.theme.sh` to enable conda env name
#!/usr/bin/env bash
#
# One line prompt showing the following configurable information
# for git:
# time (virtual_env) username@hostname pwd git_char|git_branch git_dirty_status|→
#
# The → arrow shows the exit status of the last command:
# - bold green: 0 exit status
# - bold red: non-zero exit status
#
@sam016
sam016 / Info.md
Created September 4, 2021 19:18
Track Inspiron 5520R info

Screws

  1. loosen access door screws (x3)
  2. hard drive screws (x5)
  3. remove base screws (x5)
  4. under battery screws (x4)
  5. optical drive screw (x1)
  6. screws at side of under the optical drive (x2)
  7. Palm rest screws (x6)
  8. motherboard screws (x6)
@sam016
sam016 / cecho.sh
Created January 12, 2019 16:14
Awsome Bash Snippets
#!/bin/bash
# author:
# https://stackoverflow.com/a/28709668/1957036
cecho() {
local code="\033["
case "$1" in
black | bk) color="${code}0;30m";;
red | r) color="${code}1;31m";;
@sam016
sam016 / Streaming.h
Created August 25, 2018 09:41
Awesome Arduino Libraries
/*
Streaming.h - Arduino library for supporting the << streaming operator
Copyright (c) 2010-2012 Mikal Hart. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
@sam016
sam016 / AllGattCharacteristics.java
Last active October 10, 2024 21:07
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
@sam016
sam016 / bits_operation.h
Created April 8, 2018 16:35 — forked from leonid-ed/bits_operation.h
Macros for bit's manipulation: get bit, set bit, reset bit.
#define GET_BIT(X,N) ( ( (X) >> (N) ) & 1 )
#define SET_BIT(X,N) ( (X) | (1 << (N) ) )
#define RST_BIT(X,N) ( (X) & ~(1 << (N) ) )
@sam016
sam016 / index.html
Last active June 8, 2023 09:28
Alphabets letters created via SVG path // source http://jsbin.com/nacirij
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="SVG Alphabets">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>SVG Letters</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<style id="jsbin-css">
@sam016
sam016 / index.html
Last active February 17, 2018 12:43
JS Bin Grid based letter designs// source http://jsbin.com/jorijaf
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Grid Alphabets">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<style id="jsbin-css">
@sam016
sam016 / gist:269f4474abef66f90615bc5112a8f512
Created November 1, 2017 18:23 — forked from anildigital/gist:862675ec1b7bccabc311
Remove dangling docker images
docker rmi $(docker images -q -f dangling=true)
@sam016
sam016 / breadcrump.twig
Last active January 13, 2017 17:03 — forked from mortendk/breadcrump.twig
twig breadcrumbs
{#
/**
* @file
* Returns HTML for a breadcrumb trail.
*
* @param $variables
* An associative array containing:
* - breadcrumb: An array containing the breadcrumb links.
*
* @ingroup themeable