Skip to content

Instantly share code, notes, and snippets.

@aharshac
aharshac / index.html
Last active February 19, 2017 07:11
Collaborizm logo for Nokia 5510 Monochrome LCD
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<svg preserveAspectRatio="none" viewBox="0 0 75.2 75.3" width="30" height="30" data-reactid="30">
<path id="circle" fill="#f6f9fc;" d="M46.2,57.7C45,59.4,42.6,62,37.4,62c-4.9,0-7.4-2.3-8.6-4c-1.7-2.5-1.7-5.5-1.7-8.3V26.3 c0-1.1,0.1-2.2,0.1-3.3c0.1-1.8,0.5-8,6.7-9.9c1.4-0.5,2.5-0.6,4-0.6c3.6,0,5.5,1.1,6.7,2.1c1,0.8,1.8,1.9,2.3,3c1,2.2,1,4.4,1,6.7 v4.2h-6.4V23c0-1,0.3-5-3.9-5c-1.4,0-2.1,0.4-2.6,0.8c-1.6,1.4-1.4,3.4-1.4,5.3v26.8c0,0.6,0,1.1,0.1,1.7c0.1,1.3,0.3,3.9,3.8,3.9 c0.4,0,1.5,0.1,2.5-0.7c1.7-1.2,1.6-3.2,1.6-5v-5.5H48v5.1C48,53,47.7,55.4,46.2,57.7 M0,37.7c0,20.8,16.9,37.6,37.6,37.6 c20.8,0,37.6-16.9,37.6-37.6S58.5,0,37.7,0S0,16.9,0,37.7" data-reactid="31"/>
<polyline id="lightning" fill="#f6f9fc;" points="48.2,32.4 43.3,32.4 41.5,36.6 43.6,36.6 41.2,42.8 48.1,36.6 46.2,36.6 48.2,32.4 " data-reactid="32"/>
</svg>
</body>
@aharshac
aharshac / cizm-table.css
Last active April 5, 2017 19:32
Table CSS for Collaborizm
/*
Classes: cizm-table cizm-table-striped cizm-table-bordered cizm-table-hover cizm-table-condensed
cizm-table = main
cizm-table-striped = alternate coloured rows
cizm-table-bordered = table border
cizm-table-hover = interactive hover
cizm-table-condensed = lesser cell paddiing
*/
|Pin|To|Peripherals|Peripherals|To|Pin|
|--- |--- |--- |--- |--- |--- |
|1|-|3.3V|5V|-|2|
|3|-|SDA0|5V|Relay VCC (Headlight)|4|
|5|-|SCL0|GND|Relay GND (Headlight)|6|
|7|L298N D2 (LHS Fwd)|GPIO4|GPIO14/TXD0|-|8|
|9|L298N GND (0V)|GND|GPIO15/RXD0|-|10|
|11|L298N D1 (LHS Rev)|GPIO17|GPIO18/PWM0|Pan Servo SIG|12|
|13|L298N D4 (RHS Fwd)|GPIO27|GND|-|14|
|15|L298N D3 (RHS Rev)|GPIO22|GPIO23|Relay SIG (Headlight)|16|
@aharshac
aharshac / collaborizm-community-fix-1.min.css
Last active April 25, 2017 04:19
collaborizm-community-fix-1.min
table{background-color:#fff;width:100%;max-width:100%;margin-top:20px!important;margin-bottom:20px!important;border-collapse:collapse}table>thead>tr>th{line-height:1.4285714}table>tbody>tr>td,table>tbody>tr>th,table>tfoot>tr>td,table>tfoot>tr>th,table>thead>tr>td{line-height:1.4285714;vertical-align:top;text-align:left}table>thead>tr>th{vertical-align:bottom;font-weight:700}table>caption+thead>tr:first-child>td,table>caption+thead>tr:first-child>th,table>colgroup+thead>tr:first-child>td,table>colgroup+thead>tr:first-child>th,table>thead:first-child>tr:first-child>td,table>thead:first-child>tr:first-child>th{border-top:0}table>tbody+tbody{border-top:2px solid #ddd}table>tbody>tr>td,table>tbody>tr>th,table>tfoot>tr>td,table>tfoot>tr>th,table>thead>tr>td,table>thead>tr>th{padding:5px}table,table>tbody>tr>td,table>tbody>tr>th,table>tfoot>tr>td,table>tfoot>tr>th,table>thead>tr>td,table>thead>tr>th{border:1px solid #ddd}table>thead>tr>td,table>thead>tr>th{border-bottom-width:2px}table>tbody>tr:nth-child(odd)>td,tab
@aharshac
aharshac / collaborizm-community-fix-1.css
Last active April 25, 2017 04:16
collaborizm-community-fix-1
table
{
background-color: #fff;
width: 100%;
max-width: 100%;
margin-top: 20px !important;
margin-bottom: 20px !important;
border-collapse: collapse;
}
@aharshac
aharshac / Fetch URL title - Node.js
Last active February 25, 2021 06:47
Node.js snippet to fetch URL title
var request = require('request');
var cheerio = require('cheerio');
function fetchTitle(url, onComplete = null) {
request(url, function (error, response, body) {
var output = url; // default to URL
if (!error && response.statusCode === 200) {
var $ = cheerio.load(body);
console.log(`URL = ${url}`);
@aharshac
aharshac / CFM.md
Last active July 1, 2017 20:51
Collaborizm Flavoured Markdown

Collaborizm Flavoured Markdown (CFM) is an extension of GitHub Flavoured Markdown (GFM) Markdown-it is used on Collaborizm to parse Markdown to HTML.

CFM is the work of @Robert Lancer and @Anton Voltchok

This reference is posted in the best interest of new users. #hello

@Steven Reubenstone

 

@aharshac
aharshac / FW RPi Screen Rotation.md
Last active July 17, 2018 11:28
Commands for screen rotation

Normal Screen

  1. sudo sed -i -r 's/dtoverlay\s*=\s*waveshare35a(\s*:\s*rotate\s*=\s*([0-9]{1,3})){0,1}/dtoverlay=waveshare35a/g' /boot/config.txt
  2. sudo sed -i -r 's/Option\s+\"TransformationMatrix\"\s+\"(.+)\"/Option \"TransformationMatrix\" \"0 -1 1 1 0 0 0 0 1\"/g' /etc/X11/xorg.conf.d/99-calibration.conf
  3. sudo reboot now

 

Rotated Screen

  1. sudo sed -i -r 's/dtoverlay\s*=\s*waveshare35a(\s*:\s*rotate\s*=\s*([0-9]{1,3})){0,1}/dtoverlay=waveshare35a:rotate=270/g' /boot/config.txt
  2. sudo sed -i -r 's/Option\s+\"TransformationMatrix\"\s+\"(.+)\"/Option \"TransformationMatrix\" \"0 1 0 -1 0 1 0 0 1\"/g' /etc/X11/xorg.conf.d/99-calibration.conf
@aharshac
aharshac / start.gcode
Last active September 3, 2018 10:00
Julia 2018 Pro Dual - print with secondary nozzle
G21 ;metric values
G90 ;absolute positioning
M107 ;start with the fan off
G28 X0 Y0 ;move X/Y to min endstops
G28 Z0 ;move Z to min endstops
M420 S1 ;enabled bed leveling
T1 ;select hotend 1
G92 E0 ;reset extruder distance
G1 Z10 F300 ;move nozzle up 10mm for safe homing
@aharshac
aharshac / waveshare35a.txt
Created April 7, 2019 08:40
Waveshare screen config - Madhu N
1. use this /boot/cmdline.txt:
dwc_otg.lpm_enable=0 console=tty1 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo
2. edit the end of /boot/config.txt to contain:
dtparam=audio=on
dtparam=spi=on
dtoverlay=ads7846,penirq=25,penirq_pull=2,xohms=150,swapxy=1,xmin=300,ymin=700,xmax=3800,ymax=3400,pmax=255
dtoverlay=waveshare35a