Skip to content

Instantly share code, notes, and snippets.

@codesynapse
codesynapse / crypto_prices.js
Created February 3, 2018 14:15
CoinmarketCAP prices for popular crypto currency NODE Script
var CoinMarketCap = require("node-coinmarketcap");
var coinmarketcap = new CoinMarketCap();
coinmarketcap.multi(coins => {
console.log('BTC :'+ coins.get("BTC").price_usd);
console.log('ETH :'+ coins.get("ETH").price_usd);
console.log('DASH :'+coins.get("DASH").price_usd);
console.log('BCH :'+ coins.get("BCH").price_usd);
console.log('STEEM :'+ coins.get("STEEM").price_usd);
console.log('Litecoin :'+ coins.get("LTC").price_usd);
console.log('Bitcoin Gold :'+ coins.get("BTG").price_usd);
@codesynapse
codesynapse / sample.js
Created February 2, 2018 10:49
Node Express PUG template example
var express = require('express')
var app = express()
const pug = require('pug');
app.set('view engine', 'pug')
app.get('/', function (req, res) {
res.render(
'sample',
{ title: 'Hey Hey Hey!', message: 'Express Devnami'})
})
@codesynapse
codesynapse / sample.js
Created February 1, 2018 12:04
NodeJS Express Foundation static file hosting
var express = require('express')
var app = express()
var router = express.Router()
var path = __dirname + '/views/'
app.use('/',router)
router.get('/',function(req, res){
res.sendFile(path + 'foundation.html');
@codesynapse
codesynapse / freewrite-markdown.md
Created November 28, 2017 17:52
Freewrite Markdown Template

Freewrite Prompt : Prompt Name


@codesynapse
codesynapse / CasperJS-install-fix.js
Created January 11, 2016 10:23
Fix to add in CasperJS 1.0.4 file - bootstrap.js in Line 31 onwards
/*Install issue fix */
var system = require('system');
var argsdeprecated = system.args;
argsdeprecated.shift();
phantom.args = argsdeprecated;
@codesynapse
codesynapse / hover-table.css
Created July 8, 2014 10:51
CSS Table with Mouseover Color Change
table {font-family:Arial,serif;font-size:12px;color:#333333;width:100%;border-width: 1px;border-color: #729ea5;border-collapse: collapse;}
table th {font-size:12px;background-color:#acc8cc;border-width: 1px;padding: 8px;border-style: solid;border-color: #729ea5;text-align:left;}
table tr {background-color:#d4e3e5;}
table td {font-size:12px;border-width: 1px;padding: 8px;border-style: solid;border-color: #729ea5;}
table tr:hover {background-color:#ffffff;}
@codesynapse
codesynapse / urlextract.py
Created February 26, 2014 16:10
How to extract URL from HTML Page using BeautifulSoup Python Library
from bs4 import BeautifulSoup
import requests
url= raw_input("Enter the search query :");
re=requests.get("http://"+url);
data = re.text
@codesynapse
codesynapse / browsser-open.py
Last active August 29, 2015 13:56
How to Open a Web Browser from Python
# For documentation of the webbrowser module,
# see http://docs.python.org/library/webbrowser.html
import webbrowser
new = 2 # open in a new tab, if possible
# open a public URL, in this case, the webbrowser docs
@codesynapse
codesynapse / fuctions.php
Created October 15, 2013 14:06
Youtube/Medium.com LIke Progress Bar at Top on Genesis WordPress Theme
//code you need to add to functions.php file for adding JS file in js directory
add_action( 'wp_enqueue_scripts', 'gen_progressbar');
function gen_progressbar() {
wp_enqueue_script( 'custom-script', get_stylesheet_directory_uri() . '/js/gen-progress.js', array( 'jquery' ) );
}
@codesynapse
codesynapse / send.php
Last active December 20, 2015 05:59
File Upload using PHP
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>File Upload Example</title>
</head>
<body>
<form method="post" action="upload.php" enctype="multipart/form-data">
<label> Upload your file</label><br/>
<input type="file" name="file" id="file"><br/>