Skip to content

Instantly share code, notes, and snippets.

View amyinorbit's full-sized avatar

Amy Parent amyinorbit

View GitHub Profile
@amyinorbit
amyinorbit / example.css
Created June 26, 2012 10:44
Link CSS management
/* définition du style des liens "normaux (non survolés)*/
a {
color: #666666;
background-color: transparent;
}
/* maintenant, en ajoutant ":hover", on définit le style au survol */
a:hover {
color: #FF00000; /* la couleur des liens survolés */
@amyinorbit
amyinorbit / vimeo_embed.html
Created June 28, 2012 20:16
Video posting on London Framewodk
<div class="video-container">
<iframe src="http://player.vimeo.com/video/41283932" width="500" height="281" frameborder="0">
</iframe>
</div>
<!-- note that width and height parameters are useless here because mian CSS sets them dynamically after page loading. They are however required to be valid HTML, according to the W3C specification -->
@amyinorbit
amyinorbit / wp-json-index.php
Created January 8, 2014 11:49
Sample (probably not right) json index generation code for wordpress
<?php
$postsArray = Array(); // un tableau vide
while ( have_posts() ) : the_post(); // on boucle avec tous les articles
$currentPost = Array(); // un tableau vide pour l'article en cours
$currentPost["title"] = the_title(); // on ajoute le titre
$currentPost["url"] = the_permalink(); // l'url
array_push($postsArray, $currentPost); // et on ajoute le tableau de l'article au tableau global
@amyinorbit
amyinorbit / functions.php
Last active January 2, 2016 14:19
Crée un fichier search.json à la racine d'un blog wordpress
add_action( 'transition_post_status', 'a_new_post', 10, 3 );
function a_new_post( $new_status, $old_status, $post )
{
if ( 'publish' !== $new_status or 'publish' === $old_status )
{
return;
}
$postsArray = Array(); // un tableau vide
@amyinorbit
amyinorbit / search.js
Last active January 2, 2016 14:29
Recherche dans search.json
var searchIndex = null;
var results = [];
jQuery(document).ready(function() {
Search.getSearchIndex();
jQuery('#s').keyup(function() {
// get search term
var search_term = jQuery(this).val().toLowerCase();
// run the search
Search.doSearch(search_term);
@amyinorbit
amyinorbit / php-fuckery.php
Created June 25, 2014 12:19
Type conversion in php
<?php
$a = "";
var_dump(($a == null)); //outputs false
var_dump(($a === null)); //outputs true
var_dump(is_null($a)); //outputs true
$b;
var_dump(($b == null)); //outputs true
var_dump(($b === null)); //outputs true
@amyinorbit
amyinorbit / new_shepard.ks
Created August 21, 2016 10:38
(badly commented and organised) autopilot code for New Shepard - Style landing in KSP
declare function neutral {
return ship:mass*9.81 / ship:availablethrust.
}
declare function limits {
declare parameter value.
return min(max(value, 0), 1.0).
}
declare function steer_iip {
@amyinorbit
amyinorbit / wpa_supplicant.conf
Last active September 15, 2017 18:20
Abertay Eduroam RPi WiFi Config
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB
network={
ssid="eduroam"
key_mgmt=WPA-EAP
identity="ABERTAY STUDENT NO"
password="ABERTAY PASSWORD"
@amyinorbit
amyinorbit / test.orbit
Last active September 28, 2017 15:41
Orbit AST Tests
fun fibonacci(n: Number) -> Number {
if n < 2 {
return 1
}
return fibonacci(n-2) + fibonacci(n-1)
}
fun main() -> Void {
print("OrbitVM running on " + System.getOS())
print("Fibonacci demo:")
@amyinorbit
amyinorbit / orbit_stringpool_1.c
Created April 22, 2018 21:21
Naive, 20-minute string pool for the orbit compiler. Probably needs better indexing than what is currently implemented
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
typedef uint32_t StringID;
typedef struct _String String;
typedef struct _StringPool StringPool;