Skip to content

Instantly share code, notes, and snippets.

View stevester94's full-sized avatar

Steven Mackey stevester94

View GitHub Profile

Resources

Really great for messing around with backend code without having to spend a ton of time setting your computer up. Plus you can share the link for a repl.it and colaborate.

Tutorials

Python Hello World

https://www.programiz.com/python-programming/examples/hello-world The first program any programmer writes in a new language. Copy the code here into a new repl.it (or whatever else you're using to run python code). Once you have hello world running you're ready to jump into the Intro to Python tutorial.

Country Int Olympic Committee code ISO code Country
Afghanistan AFG AF Afghanistan
Albania ALB AL Albania
Algeria ALG DZ Algeria
American Samoa* ASA AS American Samoa*
Andorra AND AD Andorra
Angola ANG AO Angola
Antigua and Barbuda ANT AG Antigua and Barbuda
Argentina ARG AR Argentina
Armenia ARM AM Armenia
This is intended to setup a headless raspberry pi
<pi mount point>/rootfs/etc/dhcpcd.conf
Also put a file called ssh in <pi mount point>/boot
Be sure to configure the pi to use ssh on the first boot, as the ssh file gets cleared on each boot
#! /bin/bash
virt-install \
--name centos7 \
--ram 1024 \
--disk path=./centos7.qcow2,size=8 \
--vcpus 1 \
--os-type linux \
--os-variant centos7 \
--network bridge=virbr0 \
<!doctype html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#overlay").click(function() { $("#overlay").hide(); });
$("#show-anchor").click(function() { $("#overlay").show(); });
});
@stevester94
stevester94 / testing.hs
Last active May 1, 2017 20:59
Haskell learning
-- Load with ':l testing.hs'
-- if working in the interpretter, you use the keyword 'let' to define shit
doubleMe x = x + x
addThem x y = x + y
hardLimit x = if x > 10
then 10
else x
@stevester94
stevester94 / git-cheat-list.md
Created February 17, 2017 23:31
Git cheat list

Git cheat list

  • name of the current banch and nothing else (for automation)

    git rev-parse --abbrev-ref HEAD
    
  • all commits that your branch have that are not yet in master

    git log master..<HERE_COMES_YOUR_BRANCH_NAME>
    
var http = require('http');
//The url we want is: 'www.random.org/integers/?num=1&min=1&max=10&col=1&base=10&format=plain&rnd=new'
var options = {
host: 'www.reddit.com',
path: '/index.html'
};
callback = function(response) {
var str = '';
/* CSS used here will be applied after bootstrap.css */
ul {
background-color: grey;
list-style: none; /* No bullets */
text-align:center; /* center li's in ul */
margin: auto; /* Center ul in div */
padding: 0; /* Because apparently padding has non-zero default */
width: 100%;
display: table;
}
#include <stdio.h>
#include <string.h>
// r $(python -c 'print ( ("AA"*16 + "FF"*8 + "7d05400000000000").decode("hex"))')
// gcc stackOverflowTesting.c -fno-stack-protector -g
//buffer || (stack pointer, 8bytes) || (return pointer, 8bytes)
//Address is 8 bytes, 64 bit machine