Skip to content

Instantly share code, notes, and snippets.

View syntaxhacker's full-sized avatar
🧠
upgrading...

Rohit J syntaxhacker

🧠
upgrading...
View GitHub Profile
@syntaxhacker
syntaxhacker / postman.desktop
Created January 23, 2020 17:41 — forked from hauthorn/postman.desktop
Postman desktop entry
[Desktop Entry]
Type=Application
Version=1.0
Name=Postman
Comment=Supercharge your API workflow
Icon=/home/hauthorn/Programs/Postman/resources/app/assets/icon.png
Exec="/home/hauthorn/Programs/Postman/Postman"
@syntaxhacker
syntaxhacker / delete-heroku-apps.sh
Created January 22, 2020 18:49 — forked from naaman/delete-heroku-apps.sh
Delete all heroku apps from bash terminal -- no script file required
for app in $(heroku apps); do heroku apps:destroy --app $app --confirm $app; done
@syntaxhacker
syntaxhacker / zsh.md
Created January 14, 2020 06:58 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
from matplotlib import pyplot as plt
import cv2
img = cv2.imread('/Users/mustafa/test.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
plt.imshow(gray)
plt.title('my picture')
plt.show()
@syntaxhacker
syntaxhacker / cp
Last active August 2, 2019 05:26
Cp
//getNumberOfWaysToClimbStairs
An O(n) time and O(1) space solution:
private static int getNumberOfWaysToClimbStairs(int n) {
int a = 1, b = 2, c = 4, d = 0;
if (n == 0 || n == 1 || n == 2)
return n;
if (n == 3)
return c;
@syntaxhacker
syntaxhacker / Documentatio_bigint.md
Created June 11, 2019 14:37 — forked from harshraj22/Documentatio_bigint.md
A documentation for using the bigint.cpp

How to use ?

1. Create an instance (object) by either of the following ways :

1.1 Without providing any initial value -
    bigint b;
    cout<<b<<"\n"; 
0
1.2. With a long long int -
@syntaxhacker
syntaxhacker / regexCheatsheet.js
Created April 23, 2019 13:10 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@syntaxhacker
syntaxhacker / comp_macros.h
Created April 4, 2019 19:03 — forked from abinashmeher999/comp_macros.h
Some of the most used macros in competitive programming
#include <cmath>
#include <climits>
#include <queue>
#include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream> // istringstream buffer(myString);
@syntaxhacker
syntaxhacker / mp3.js
Created February 25, 2019 19:53 — forked from dtrce/mp3.js
streaming mp3 using nodejs
var http = require('http'),
fileSystem = require('fs'),
path = require('path')
util = require('util');
http.createServer(function(request, response) {
var filePath = 'path_to_file.mp3';
var stat = fileSystem.statSync(filePath);
response.writeHead(200, {
wget https://docs.google.com/uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE&export=download
mv uc\?id\=0B3X9GlR6EmbnWksyTEtCM0VfaFE gdrive
chmod +x gdrive
sudo install gdrive /usr/local/bin/gdrive
gdrive list
gdrive upload filename