Skip to content

Instantly share code, notes, and snippets.

View vg's full-sized avatar
🐳
πŸŒŠπŸŒŠβ›΅πŸŒŠπŸŒŠπŸŒŠ

ΰ€΅ΰ₯‡ΰ€£ΰ₯ ΰ€—ΰ₯‹ΰ€ͺΰ€Ύΰ€² vg

🐳
πŸŒŠπŸŒŠβ›΅πŸŒŠπŸŒŠπŸŒŠ
View GitHub Profile
@vg
vg / cgpa.c
Created February 22, 2010 09:37
Can someone rewrite this C code in Java
#include <stdio.h>
#define MAXVAL 255 /* maximum size of an input line */
main ()
{
FILE *fp1, *fp2, *fopen (); /* file pointer declarations */
char line[MAXVAL]; /* line read from the file.max 255 chars */
int a, b, c, result;
char student[100]; /* assume student name is <= 100 characters */
float cgpa;
fp1 = fopen ("in2.dat", "r");
+++++ +++++ initialize counter (cell #0) to 10
[ use loop to set the next four cells to 70/100/30/10
> +++++ ++ add 7 to cell #1
> +++++ +++++ add 10 to cell #2
> +++ add 3 to cell #3
> + add 1 to cell #4
<<<< - decrement counter (cell #0)
]
> ++ . print 'H'
> + . print 'e'
@vg
vg / 0.unix5e.echo.c
Last active August 29, 2015 13:57
echo.c implementations
main(argc, argv)
int argc;
char *argv[];
{
int i;
argc--;
for(i=1; i<=argc; i++)
printf("%s%c", argv[i], i==argc? '\n': ' ');
}
@vg
vg / keybase.md
Last active April 10, 2016 00:37
keybase.md

Keybase proof

I hereby claim:

  • I am vg on github.
  • I am vg (https://keybase.io/vg) on keybase.
  • I have a public key whose fingerprint is 18A0 A4DB B7F1 5C96 1230 28FD F2C9 EF15 5DF8 FC44

To claim this, I am signing this object:

@vg
vg / quicktime-hangouts-recording.md
Created May 22, 2017 03:49 — forked from caseywatts/quicktime-hangouts-recording.md
Quicktime Hangouts Recording (using soundflower for audio)

Short link to this page: caseywatts.com/quicktime

Scenario: You want to talk with someone over google hangouts (like for a user study), and you want to record BOTH:

  • the system output audio (from them)
  • the microphone audio (from you)

(screenshots below in a comment)

General Setup (do this once)

@vg
vg / openstack-cheatsheet.txt
Created July 11, 2017 01:23 — forked from elemoine/openstack-cheatsheet.txt
OpenStack cheatsheet
keystone
--------
keystone tenant-list
openstack project list
keystone tenant-create --name <tenant-name> --description <tenant-desc> --enabled true
openstack project create <project-name> --description <project-desc> --enable
keystone user-create --name <user-name> --tenant <tenant-name> --pass <user-password> --email <user-email> --enabled true
@vg
vg / slack-pagerduty-oncall.py
Created August 15, 2017 08:11 — forked from devdazed/slack-pagerduty-oncall.py
Updates a Slack User Group with People that are on call in PagerDuty
#!/usr/bin/env python
from __future__ import print_function
import json
import logging
from urllib2 import Request, urlopen, URLError, HTTPError
from base64 import b64decode
@vg
vg / create-iso.sh
Created September 9, 2017 00:26 — forked from julianxhokaxhiu/create-iso.sh
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
|=-----------------------------------------------------------------------=|
|=----------------------------=[ BootChess ]=----------------------------=|
|=-----------------------------------------------------------------------=|
|=------------------------=[ by Baudsurfer/rsi ]=------------------------=|
|=-----------------------------------------------------------------------=|
1 - Introduction
1.1 - Why make tiny programs ?
1.2 - Proving know-how remains valued