Skip to content

Instantly share code, notes, and snippets.

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
void main() {
char *str;
str = malloc(sizeof(char) * 15);
strcpy(str, "hakuna matata!"); // this line should copy "hakuna matata!"
// into our char array
printf("%s\n", str);
#include <stdio.h>
void square(int *num) {
*num *= *num;
}
int main() {
int x = 4;
square(&x);
printf("%d\n", x);
#include <stdio.h>
int main(int argc, char ** argv){
unsigned i = 1;
if (argc > 1) {
prt:
printf("%s\n", argv[i]);
i++;
if (i < argc) {
#include <stdio.h>
int factorial (int n) {
int i = 1;
while (n > 1) {
i *= n;
n -= 1;
}
return i;
}
#include <stdio.h>
int main();
int main(){
unsigned int i, k;
unsigned int j = 0;
for (i = 0; i < 100; i++) {
printf("%d\n", j);
require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = '[email protected]'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }
#!/bin/sh
REPODIR=~/repo/rhel/
SRPMS=$REPODIR/SRPMS
RELEASES=6
ARCHS=x86_64
CREATEREPO="createrepo -d --update"
# Sign all packages
#PACKAGES=`find $REPODIR -name \*.rpm -printf '%p '`
@dafyddcrosby
dafyddcrosby / gist:4408779
Last active April 2, 2018 12:30
List of packages to install to run Steam on Fedora 17 64-bit (note - you will need to install the rpmfusion repos)
mesa-dri-filesystem.i686
libgcc.i686
glibc.i686
nss-softokn-freebl.i686
zlib.i686
libstdc++.i686
freetype.i686
nspr.i686
libogg.i686
libjpeg-turbo.i686
@dafyddcrosby
dafyddcrosby / gist:4208475
Created December 4, 2012 20:42
Sending HTTP to HTTPS port
$ curl https://api.github.com
{
"user_repositories_url": "/users/{user}/repos{?type,page,per_page,sort}",
"hub_url": "/hub",
"starred_gists_url": "/gists/starred",
"starred_url": "/user/starred{/owner}{/repo}",
"current_user_url": "/user",
"keys_url": "/user/keys",
"user_organizations_url": "/user/orgs",
"team_url": "/teams",