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 / iris-tensorflow-js.js
Created September 2, 2018 18:19 — forked from learncodeacademy/iris-tensorflow-js.js
Solving Iris with Tensorflow.js and Iris JSON dataset
import * as tf from "@tensorflow/tfjs"
import "@tensorflow/tfjs-node"
import iris from "./iris.json"
import irisTesting from "./iris-testing.json"
// convert/setup our data
const trainingData = tf.tensor2d(iris.map(item => [
item.sepal_length, item.sepal_width, item.petal_length, item.petal_width,
]))
const outputData = tf.tensor2d(iris.map(item => [
@syntaxhacker
syntaxhacker / node_cheerio_scraping.js
Last active September 5, 2018 13:25 — forked from bradtraversy/node_cheerio_scraping.js
Simple example to scrape some posts and put into a CSV file using Node & Cheerio
const request = require('request');
const cheerio = require('cheerio');
const fs = require('fs');
const writeStream = fs.createWriteStream('post.csv');
// Write Headers
writeStream.write(`Title,Link,Date \n`);
request('http://codedemos.com/sampleblog', (error, response, html) => {
if (!error && response.statusCode == 200) {
@syntaxhacker
syntaxhacker / sql
Created September 6, 2018 12:45
Php and mysql
SET PASSWORD FOR 'jrohit072'@'%' = PASSWORD('welcome');
<?php
$servername = getenv('IP');
$username = getenv('C9_USER');
$password = "welcome"; //db pass
$database = "c9"; //db name
$dbport = 3306;
// Create connection
$db = new mysqli($servername, $username, $password, $database, $dbport);
@syntaxhacker
syntaxhacker / stdc++.h
Created November 2, 2018 11:21 — forked from velicast/stdc++.h
Linux GCC 4.8.0 /bits/stdc++.h header definition.
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
Before starting NProgress.start(); function you need to change the color code in
#nprogress .bar {
background: #29d !important;
}
@syntaxhacker
syntaxhacker / gist:6f24bff5a7fdd0463b8333da7816bc77
Last active November 22, 2018 17:38
set a JavaScript onclick event to a class with css
cliked(){
document.body.onclick= function(e){
e=window.event? event.srcElement: e.target;
if(e.className && e.className.indexOf('event1')!=-1){
}
}
}
wget --user-agent="Googlebot/2.1 (+http://www.googlebot.com/bot.html)" --html-extension -r http://site.com
wget -c -A '*.mp3' -r -l 1 -nd https://archive.org/download/El_Psy_Kongroo
version 2
wget --mirror --convert-links --page-requisites --no-parent http://vfxdownload.com/
@syntaxhacker
syntaxhacker / cheetah-inst.sh
Created November 26, 2018 06:28 — forked from rogerdudler/cheetah-inst.sh
Cheetah Installation
wget http://pypi.python.org/packages/source/C/Cheetah/Cheetah-2.4.4.tar.gz
tar xvfz Cheetah-2.4.4.tar.gz
cd Cheetah-2.4.4
sudo python setup.py install
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