Skip to content

Instantly share code, notes, and snippets.

View SoxFace's full-sized avatar

Sonya SoxFace

View GitHub Profile
@SoxFace
SoxFace / ft_print_comb2.c
Last active November 17, 2022 05:49
42 Piscine
#include <unistd.h>
void ft_putchar(char c)
{
write(1, &c, 1);
}
void ft_print_comb2(void);
int main()
@SoxFace
SoxFace / 2019OCT10.rb
Last active October 10, 2019 10:20
Riddle me Gabe
def example(a) # function a
b = [] # b is an empty array
for i in 0..a # for every (i)ndex in the range 0 to a (or 4 in this example)
b[i] = i # not clear how this works. I think it's a shorthand for .push
# More importantly, I don't know why you have to assign the position of the index in the array to i
end # end of loop
return b #return b
end # end of function
@SoxFace
SoxFace / USyd.kml
Created October 3, 2017 04:36 — forked from extramaster/USyd.kml
A Google Maps file (kml) of Building Points from The University of Sydney
<?xml version="1.0" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Name>USyd Buildings</Name>
<Placemark>
<name>1-3 Ross Street</name>
<description>Campus: Camperdown&lt;br&gt;Building Code: K06</description>
<Point>
<coordinates>151.184341,-33.884591</coordinates>
</Point>
@SoxFace
SoxFace / gist:c3e706f5ae3ca2a1e24ede97522b317f
Created October 11, 2016 01:41 — forked from trcarden/gist:3295935
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
var request = require('request');
var app = require('express')();
var results;
function logRes(){
console.log(results);
}
app.get('/storeData', minion1(req,res){
readResult(logRes)
@SoxFace
SoxFace / array.extend.js
Created January 27, 2016 04:41 — forked from zaparker/array.extend.js
Based on the LINQ extensions for C# IEnumerables, these functions extend the base JavaScript Array object with new methods for chaining together array operations. Also includes some examples and tests.
// performs the specified action on each item in the array
Array.prototype.forEach = function (fnAction) {
var l = this.length;
for (var i = 0; i < l; ++i) {
fnAction(this[i]);
}
}
// returns an array containing the items matching the filter
Array.prototype.where = function (fnFilter) {
@SoxFace
SoxFace / deploy
Created January 20, 2016 02:02 — forked from victerryso/deploy
Meteor Deploy to Digital Ocean
# Sources
# johngibby.com/blog/How_to_deploy_your_meteor.js_app_on_Digital_Ocean
# stackoverflow.com/questions/20117104/mongodb-root-user
# digitalocean.com
# Create a Digital Ocean Ubuntu 14.04 Droplet
# You'll receive an email with your new IP and Password
# e.g.
# Droplet Name: dropletname
# IP Address: 000.000.000.000
@SoxFace
SoxFace / JSStructure.md
Created November 13, 2015 01:58 — forked from robinsonlam/JSStructure.md
Structuring your code in Javascript - Notes for WDI students to help with syntax

Code Structure

Here are some notes I've made to help you guys with your syntax. Think of it like a "cheatsheet". Some tips to remember:

  • Keep an eye on semicolons, usually control flow blocks (if blocks, for, while loops etc.) do not need a semicolon.
  • Keep an eye on your opening and closing brackets ( { & } ).
  • Be careful when using assignment operators ( = ) and equality operators ( == and === ). Assignment is for setting, equality is for comparing.
  • Keep an eye on quotation marks. Match doubles with doubles ( " ), singles with singles ( ' ).
    • Also: Watch when you're using apostrophes inside strings: var sentence = "You're weird";.
      Make sure you don't do this: var sentence = 'You're weird'; This will give you errors.
  • When checking conditions with logical operators ( &&, ||, ! ), you cannot combine your conditions.
  • Incorrect: if ( chicken === yummy &amp;&amp; tasty )
// Highcharts CheatSheet Part 1.
// Create interactive charts easily for your web projects.
// Download: http://www.highcharts.com/download
// More: http://api.highcharts.com/highcharts
// 1. Installation.
// Highcharts requires two files to run, highcharts.js and either jQuery, MooTools or Prototype or the Highcharts Standalone Framework which are used for some common JavaScript tasks.
// <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
// <script src="https://code.highcharts.com/highcharts.js"></script>