View hello.cr
# Crystal program
puts "What's your name?"
print "-> "
name = gets.to_s.chomp
puts "Your name is #{name.capitalize}"
puts "-------------" + ("-" * name.size)
# A very basic HTTP server
View Walk.js
import fs from 'fs';
const Walk = (dir, originalDir = false) => {
let results = new Array();
if (!originalDir)
originalDir = dir;
fs.readdirSync(dir).forEach(file => {
const fullFile = `${dir}/${file}`;
View Example1Chapter2
package com.gmail.kudr641;
import java.util.Scanner;
public class Example1Chapter2
{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
View 1.RegistrySnapshot.xml
<?xml version="1.0" encoding="utf-8"?>
<registrySnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<user>S-1-5-21-1953236517-242735908-2433092285-500</user>
<keys>
<key installerType="Unknown" displayName="Nightly 53.0a1 (x64 en-US)" displayVersion="53.0a1">
<RegistryView>Registry64</RegistryView>
<KeyPath>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Nightly 53.0a1 (x64 en-US)</KeyPath>
<DefaultValue />
<InstallLocation><![CDATA[C:\Program Files\Nightly]]></InstallLocation>
<UninstallString><![CDATA["C:\Program Files\Nightly\uninstall\helper.exe"]]></UninstallString>
View SumOfFileSizes.sh
#!/bin/bash
sum=0
while read line; do
read -ra cols <<< "$line"
((sum += ${cols[4]}))
done < <(ls -la | tail -n +2 )
echo $sum
View image.png
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAABCAIAAADB42C9AAAAVElEQVR42jWMOwqAMBAF5yjpbMQrWNnaWwoKpknAD+LtXQYCWwzDvAVmqHBDgksOOGCFEzboNa8mggJd67Mwyovbx1UyLvYx3JvMmuSqelN7+8HwA2+IEHzgr4OjAAAAAElFTkSuQmCC
View NeopixelRingClock.ino
#include <Adafruit_NeoPixel.h>
#include <ESP8266WiFi.h>
#include "TimeClient.h"
#define PIN D5
long lastUpdate = millis();
long lastSecond = millis();
String hours, minutes, seconds;
int currentSecond, currentMinute, currentHour;
View axidraw-manual-control.js
/*
This requires nodejs to run
install
npm install terminal-kit
npm install superagent
run
node axidraw-manual-control.js
Keys
View app.module.ts
import { NgModule } from '@angular/core';
import { RouterModule, PreloadAllModules } from '@angular/router';
import {ActivateGuard} from './guard';
import { ROUTES } from './app.routes';
import { HomeComponent } from './home';
import { NoContentComponent } from './no-content
// Application wide providers
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console