Skip to content

Instantly share code, notes, and snippets.

View jordansinger's full-sized avatar

Jordan Singer jordansinger

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
* {
margin: 0;
padding: 0;
list-style: none;
text-decoration: none;
border: none;
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
@jordansinger
jordansinger / new_gist_file
Created June 3, 2013 19:33
document ready function
$(document).ready(function() {
});
@jordansinger
jordansinger / ascii.c
Created December 18, 2015 03:35
ascii.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int NUMASCII = 127;
struct Ascii {
int code; // ascii character code
int occurrences; // number of occurrences
};
@jordansinger
jordansinger / wrap.c
Created December 18, 2015 03:37
wrap.c
#include "string.h"
#include "stdlib.h"
#include "stdio.h"
char *wrap(char *s, char wchars[]) {
char *result = malloc(strlen(s) + 3);
result[0] = wchars[0];
strcat(result, s);
result[strlen(s) + 1] = wchars[1];
return result;
@jordansinger
jordansinger / keypress.c
Created December 20, 2015 21:12
keypress.c
#include "string.h"
#include "stdlib.h"
#include "stdio.h"
int NUM_KEYS = 9; // 2 - 9 and 0
struct Number {
int number; // number on keypad
char *letters; // letters associated with number
int hits; // number of times pressed
@jordansinger
jordansinger / change.c
Last active May 4, 2016 19:49
change.c
#include "string.h"
#include "stdlib.h"
#include "stdio.h"
int denominations[] = { 10000, 5000, 2000, 1000, 500, 100, 25, 10, 5, 1 };
int NUM_DENOMINATIONS = sizeof(denominations) / sizeof(denominations[0]);
int count[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int main(int argc, char const *args[]) {
int due = atof(args[1]) * 100;
int paid = 0;
@jordansinger
jordansinger / Toggle.swift
Last active July 3, 2020 15:00
Run this in Swift Playgrounds on iPad or Mac
import SwiftUI
import PlaygroundSupport
struct ContentView: View {
@State var notificationsEnabled = true
var body: some View {
Toggle("Notifications", isOn: $notificationsEnabled)
.padding()
.frame(width: 375, height: 64)
import SwiftUI
import PlaygroundSupport
// constants
let deviceWidth: CGFloat = 320
let deviceHeight: CGFloat = 568
let hasFaceID = true // false for TouchID
struct Device: View {
var body: some View {
import SwiftUI
import PlaygroundSupport
struct Symbols: View {
var body: some View {
Image(systemName: "person.crop.circle.fill")
.font(.system(size: 96))
.foregroundColor(.blue)
}
}