This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run this to set the graphql exposed name for columns and built-in hasura graphql action to | |
// Afterwards run metadata export as the metadata set into the server does not write back out through docker to local file system | |
// `npx hasura --project ../hasura metadata export` | |
import { getIntrospectionQuery } from 'graphql' | |
import http from 'http' | |
import url from 'url' | |
import fs from 'fs' | |
import dotenv from 'dotenv' | |
import fetch from 'node-fetch' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script: my-pi-temp.sh | |
# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3 | |
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+ | |
# ------------------------------------------------------- | |
cpu=$(</sys/class/thermal/thermal_zone0/temp) | |
echo "$(date) @ $(hostname)" | |
echo "-------------------------------------------" | |
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)" | |
echo "CPU => $((cpu/1000))'C" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <xmmintrin.h> | |
#define SIZE 600 | |
float rgb_sum_product(float * pixels) { | |
float sum_red = 0.0, sum_green = 0.0, sum_blue = 0.0; | |
for (int i = 0; i < SIZE - 3; i += 3) { | |
sum_red = sum_red + pixels[i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fig. 12.3: figl2_03.c | |
// Inserting and deleting nodes in a list | |
#include <stdio.h> | |
#include <stdlib.h> | |
struct listNode { | |
char data; | |
struct listNode *nextPtr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'fileutils' | |
require 'zip' | |
# ====== INSTRUCTIONS ====== # | |
# Stick this script in the folder with your programming set folders (s1, s2 etc.) | |
# Run `gem install rubyzip`. This will allow us to zip things | |
# Change the constants below and execute with ./create_submission.rb | |
# ====== CHANGE THESE ====== # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class TriangularStars { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
Scanner input = new Scanner( System.in ); | |
String inputString=""; | |
do { | |
System.out.print("How many star&triangle number do you want? (or 'quit')"); | |
input = new Scanner( System.in ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
// This shouldn't return anything as it's writing the value to the pointer instead | |
void scan_int_into_pointer(int * z) // it receives a pointer to an int as an argument | |
{ | |
printf("enter value="); | |
scanf("%d", z); // Note: no & because z is already a pointer | |
// Note: No return value... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dokku plugins-install | |
gpg: keyring `/tmp/tmpupqa1nqp/secring.gpg' created | |
gpg: keyring `/tmp/tmpupqa1nqp/pubring.gpg' created | |
gpg: requesting key C300EE8C from hkp server keyserver.ubuntu.com | |
gpg: /tmp/tmpupqa1nqp/trustdb.gpg: trustdb created | |
gpg: key C300EE8C: public key "Launchpad Stable" imported | |
gpg: no ultimately trusted keys found | |
gpg: Total number processed: 1 | |
gpg: imported: 1 (RSA: 1) | |
Sending build context to Docker daemon 145.4 kB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SETTINGS | |
var input = "rsa ecde srgu yhgr bv rsa ecde srgu yhgr bv hybtg ser erv"; | |
input += " hybtg iii r hybtg ser erv tvr rrr rvgres rrr rvg rrr rvgres "; | |
input += "ggg rgh grs sxebbe cuuuhbgres grs sxebbe cbbbgvrsai"; | |
var TIME_INTERVAL = 300; | |
// Add jquery | |
var script = document.createElement('script'); | |
script.src = 'http://code.jquery.com/jquery-1.11.0.min.js'; | |
script.type = 'text/javascript'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/var/folders/2m/1tctt7mj4lzbq_qzj5dtltr40000gn/T/ruby-build.20140818110316.52342 ~ | |
HTTP/1.1 200 OK | |
Content-Type: binary/octet-stream | |
Content-Length: 15092388 | |
Connection: keep-alive | |
Date: Mon, 30 Jun 2014 03:05:59 GMT | |
Last-Modified: Fri, 23 May 2014 08:34:00 GMT | |
ETag: "e57fdbb8ed56e70c43f39c79da1654b2" | |
Accept-Ranges: bytes | |
Server: AmazonS3 |
NewerOlder