Skip to content

Instantly share code, notes, and snippets.

@aceakash
aceakash / 0_reuse_code.js
Created November 13, 2015 15:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@aceakash
aceakash / restaurants-dataset.json
Created November 18, 2015 13:31
Sample Restaurants Dataset (for document databases)
This file has been truncated, but you can view the full file.
{"address": {"building": "1007", "coord": [-73.856077, 40.848447], "street": "Morris Park Ave", "zipcode": "10462"}, "borough": "Bronx", "cuisine": "Bakery", "grades": [{"date": {"$date": 1393804800000}, "grade": "A", "score": 2}, {"date": {"$date": 1378857600000}, "grade": "A", "score": 6}, {"date": {"$date": 1358985600000}, "grade": "A", "score": 10}, {"date": {"$date": 1322006400000}, "grade": "A", "score": 9}, {"date": {"$date": 1299715200000}, "grade": "B", "score": 14}], "name": "Morris Park Bake Shop", "restaurant_id": "30075445"}
{"address": {"building": "469", "coord": [-73.961704, 40.662942], "street": "Flatbush Avenue", "zipcode": "11225"}, "borough": "Brooklyn", "cuisine": "Hamburgers", "grades": [{"date": {"$date": 1419897600000}, "grade": "A", "score": 8}, {"date": {"$date": 1404172800000}, "grade": "B", "score": 23}, {"date": {"$date": 1367280000000}, "grade": "A", "score": 12}, {"date": {"$date": 1336435200000}, "grade": "A", "score": 12}], "name": "Wendy'S", "restaurant_id": "30112340"}
{"add
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

To add a git alias git lg for the above:

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@aceakash
aceakash / index.html
Created May 31, 2016 19:25
React template
<!-- index.html -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>React Tutorial</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
@aceakash
aceakash / Main.elm
Created June 26, 2017 21:37
Cat gif fetcher
module Main exposing (..)
import Html exposing (Html, button, div, h1, h2, img, text)
import Html.Attributes exposing (src)
import Html.Events exposing (onClick)
import Http exposing (Error, get)
import Json.Decode exposing (Decoder, at)
main : Program Never Model Msg
@aceakash
aceakash / lemonade.svg
Last active June 29, 2017 01:57
adcap assets
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aceakash
aceakash / Main.elm
Last active June 29, 2017 15:49
Elm boilerplate
module Main exposing (..)
import Html exposing (Html, button, div, h1, text)
import Html.Events exposing (onClick)
main =
Html.program
{ init = ( initialModel, Cmd.none )
, view = view
@aceakash
aceakash / convert.py
Created September 17, 2017 17:13
Convert audio in MKV files to AC3. Required Python 3.6
import os
import subprocess
all_dir_contents = os.listdir()
mkv_files = [file for file in all_dir_contents if file.endswith('.mkv') and not file.endswith('.converted.mkv') ]
for mkv in mkv_files:
print('========== Starting ' + mkv + ' ===========')
out_file_name = mkv[:-4] + '.converted.mkv'
@aceakash
aceakash / Main.elm
Created December 10, 2017 19:21
Elm beginner program
module Main exposing (..)
import Html
main : Program Never Model Msg
main =
Html.beginnerProgram { model = initialModel, view = view, update = update }
@aceakash
aceakash / main.md
Last active April 13, 2018 12:37
SQLite3 Cheat Sheet

Open SQLite3 shell with headers and column mode on:

sqlite3 -column -header your_db.db

Meta Commands

Meta Command Description