Skip to content

Instantly share code, notes, and snippets.

View Ranner198's full-sized avatar
💭
Trying to GitGud

Ran Crump Ranner198

💭
Trying to GitGud
View GitHub Profile
@Ranner198
Ranner198 / trillapp.py
Last active October 20, 2019 16:46
TrillSpaceApp
# -*- coding: utf-8 -*-
"""TrillApp.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1b0qU_SkDafVEvhYmLhRgYzO_B-cu3KwQ
"""
# Tasks!
@Ranner198
Ranner198 / Unity_Extended_Inspector.cs
Created September 13, 2019 19:07
Example code snippet of how to extend the unity editor
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public class SampleClass : MonoBehaviour
{
[HideInInspector] // <---- This will hide the public variable in the insepector
public GameObject goVariable;
[HideInInspector]
const cheerio = require('cheerio');
const request = require('request');
var URL = 'https://www.reddit.com/r/dankmemes/';
request(URL, function(err, resp, html) {
//If there is no error
if (!err){
//The URL Data
const $ = cheerio.load(html);
const express = require('express');
const app = express();
const path = require('path');
const port = 8080;
//Tell us when the server is up and running + where at
console.log("I am running at: " + port);
//Start the listener
app.listen(port);
var json = {
"firstName": "John",
"lastName": "Smith",
"isAlive": true,
"age": 27,
"address": {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": "10021-3100"
//This is the npm package that will allow you to by-pass the 301 redirect error
const https = require('follow-redirects').https;
//This is your URL link to query the system and your username
var url = 'https://public-api.tracker.gg/apex/v1/standard/profile/<YourSystem>/<YourName>';
//This is our GET-request module
https.get(url, {
headers: {
"TRN-Api-Key" : "<YourApiKeyHere>" //<----This is where you will pass your API key to
curl https://public-api.tracker.gg/apex/v1/standard/profile/{SystemNumber}/{Username}
-H "TRN-API-KEY: {APIKeyHere}"
User$ git clone <RepositoryName>
@Ranner198
Ranner198 / WebScrape.js
Created January 9, 2019 23:47
Webscrape Tutorial Source Code
//Loading the npm packages
const cheerio = require('cheerio')
const request = require('request')
//The Url that will be scraped
var URL = 'http://rancrump.com/aboutme/';
//The attribute that will be searched, follows the HTML class and ID syntax i.e. '.' and '#'
//can also select a span by simply typing span in the begining i.e. 'span.someClassName'
var selector = '.myTopBorder'
@Ranner198
Ranner198 / WebScraper.js
Created January 9, 2019 17:49
Webscrape Code Example
//Loading the npm packages
const cheerio = require('cheerio')
const request = require('request')
//The Url that will be scraped
var URL = 'http://rancrump.com/aboutme/';
//The attribute that will be searched, follows the HTML class and ID syntax i.e. '.' and '#'
//can also select a span by simply typing span in the begining i.e. 'span.someClassName'
var selector = '.myTopBorder'