Skip to content

Instantly share code, notes, and snippets.

$quirrel Tzikas

View GitHub Profile
@osroca
osroca / index.html
Last active Sep 19, 2017
Testing BigML (bigml.io) modeling and predictions with JQuery
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>BigML Prediction Test</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script src="https://code.jquery.com/jquery-1.7.1.js" type="text/javascript"></script>
View quickSort.js
//JS QuickSort
Array.prototype.quickSort = function() {
var r = this;
if(this.length <= 1) {
return this;
}
var less = [], greater = [];
@devknoll
devknoll / gist:8b274f1c5d05230bfade
Last active Feb 19, 2019
Basic GraphQL example using the GitHub API
View gist:8b274f1c5d05230bfade
import { graphql, GraphQLString, GraphQLInt } from 'graphql';
import { objectType, enumType, schemaFrom, listOf } from 'graphql-schema';
import request from 'promisingagent';
const repositorySortEnum = enumType('RepositorySort')
.value('CREATED', 'created')
.value('UPDATED', 'updated')
.value('PUSHED', 'pushed')
.value('FULL_NAME', 'full_name')
.end();
@xxxxlr
xxxxlr / React-Native-WebView-Cookies.js
Created Jul 27, 2017 — forked from kanzitelli/React-Native-WebView-Cookies.js
React Native Trick: Get Cookies of WebView without using any native modules such as react-native-cookies. Might be helpful for getting JWT while making OAuth2 👽
View React-Native-WebView-Cookies.js
// @flow
import React, { Component } from 'react';
import {
WebView,
} from 'react-native';
class LoginScreen extends Component {
state = {
cookies : {},
View vscode-shortcuts.md

VS Code shortcuts

  • Search text through all files at once

    • Mac: Command + Shift + f
    • Windows: Ctrl + Shift + f
  • Re-open a closed editor When you have multiple open files and accidentally close one or more of them, finding them, and re-opening can be time-consuming and a little frustrating. This is an undo feature exclusively for tabs:

    • Mac: Command + Shift + t
View web-scraper_scrape.js
import axios from 'axios';
import cherrio from 'cheerio';
async function getHTML(productURL) {
const { data: html } = await axios.get(productURL, {
headers: {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36'
}
})
.catch(function (error) {
@zapthedingbat
zapthedingbat / logeverything.js
Created Aug 19, 2014
Log every function call to the console
View logeverything.js
(function() {
var call = Function.prototype.call;
Function.prototype.call = function() {
console.log(this, arguments);
return call.apply(this, arguments);
};
}());
@tleen
tleen / marvel-api-client.js
Created Mar 12, 2016
Example call to the Marvel API from js client (w/ JQuery)
View marvel-api-client.js
// you will also have to setup the referring domains on your marvel developer portal
var PRIV_KEY = "this-should-be-a-long-hash";
var PUBLIC_KEY = "so-should-this";
function getMarvelResponse() {
// you need a new ts every request
var ts = new Date().getTime();
var hash = CryptoJS.MD5(ts + PRIV_KEY + PUBLIC_KEY).toString();
@jonathansick
jonathansick / query.graphql
Last active May 21, 2020
GitHub GraphQL repo commit history query
View query.graphql
{
repository(name: "sickvim", owner: "jonathansick") {
ref(qualifiedName: "master") {
target {
... on Commit {
id
history(first: 5) {
pageInfo {
hasNextPage
}
@learncodeacademy
learncodeacademy / flightplan-html.md
Last active May 25, 2020
Deploy HTML site with Flightplan
View flightplan-html.md

###Prerequesites

Install flightplan globally

npm install -g flightplan

Install flightplan in your project folder

You can’t perform that action at this time.