Skip to content

Instantly share code, notes, and snippets.

Avatar
🐶
livin

Sahebjot singh zereraz

🐶
livin
View GitHub Profile
@zereraz
zereraz / todolist_complete.sh
Last active Dec 22, 2018
todolist (todolist.site) autocomplete
View todolist_complete.sh
#!/bin/bash
_projects() {
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts=$(todolist list by p | cut -d ' ' -f 2 | grep -E "^[^\\[]+$" | sed -e 's/^/+/g')
if [[ ${cur} == +* ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
View functor
module Main where
import Prelude
import Effect (Effect)
import Effect.Console (log)
data Maybe a = Nothing | Just a
a :: Maybe Int
@zereraz
zereraz / c_create.sh
Last active Oct 26, 2016
a script to create c files and open it in vim, "alias c_create=. c_create" is put in .zshrc or .bashrc file
View c_create.sh
#!/bin/bash
# first argument is the name of the folder and the c file
fileName=$1
# change to the desired folder
filePath='/Users/apple/Documents/coding/c/c_generated/'
folderToCreate="$filePath$fileName"
fileToCreate="$filePath$fileName/$fileName.c"
helloWorld="#include<stdio.h>\n\nint main(){\n\tprintf(\"Hello world\");\n}\n"
if [ ! -d "$folderToCreate" ]; then
@zereraz
zereraz / Bluetooth_edison.md
Last active Aug 29, 2015
Bluetooth edison
View Bluetooth_edison.md

Commands

  • rfkill unblock bluetooth (first time)
  • hciconfig (status of bluetooth)
  • hciconfig name up (start bluetooth)
  • hciconfig name down (start bluetooth)
View gist:0e7ff9c46c3b8c89eef5
var http = require('http');
var nullList = [];
function process(key,value) {
if(value === null || value === undefined){
nullList.push({
'key':key,
'value': value
})
You can’t perform that action at this time.