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 / LockScreen.swift
Created May 11, 2020 23:24
Let’s recreate the iPhone lock screen using SwiftUI and Swift Playgrounds on iPad
import SwiftUI
import PlaygroundSupport
struct Screen: View {
var body: some View {
ScrollView {
VStack {
Text("5:45").font(.system(size: 64, weight: .thin))
Text("Monday, May 11").font(.system(size: 24))
}.padding(.vertical, 32)
import SwiftUI
import PlaygroundSupport
struct Screen: View {
var body: some View {
VStack {
ForEach(1...4, id: \.self) { _ in
HStack {
Spacer()
VStack {
import SwiftUI
import PlaygroundSupport
struct Screen: View {
var body: some View {
NavigationView {
List {
Section {
NavigationLink(destination: Text("Detail View")) {
HStack {