Skip to content

Instantly share code, notes, and snippets.

View Jai-JAP's full-sized avatar

Jai A P Jai-JAP

View GitHub Profile
@rampion
rampion / try-catch-ex.c
Created April 8, 2009 02:35
TRY/CATCH/FINALLY macros for C
// gcc -o try-catch-ex try-catch.c try-catch-ex.c
#include <stdio.h>
#include "try-catch.h"
// Example of use for try-catch.h
int main(int argc, char *argv[])
{
int i = 101;
printf("before try block...\n");
@zed
zed / main.c
Created April 18, 2010 19:32
compare relative performance of tolower_ctype, tolower_openbsd, tolower_oraz functions
// compare relative performance of tolower_ctype, tolower_openbsd, tolower_oraz functions
// result: 30.80, 30.51, 38.09
// $ gcc -std=c99 -O3 -g -Wall -pedantic test_tolower.c -o test_tolower;
// $ valgrind --tool=callgrind ./test_tolower 1000000
#include <assert.h>
#include <ctype.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@riipandi
riipandi / linux-cmd-cheatsheet.md
Created July 12, 2012 12:16
Linux Command Cheat Sheet

#Linux Cheat Sheet

##File Commands:

  • ls – directory listing
  • ls -al – formatted listing with hidden files
  • cd dir - change directory to dir
  • cd – change to home
  • pwd – show current directory
  • mkdir dir – create a directory dir
  • rm file – delete file
# Set up a new VPS for Framework (Ubuntu 12.04)
1. Add personal user
* Add user to 'admin/sudo' and 'www-data' groups
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install python-software-properties -y && sudo add-apt-repository ppa:keithw/mosh -y && sudo apt-get update && sudo apt-get install mosh -y && sudo tasksel && sudo apt-get install php5 php5-gd php5-mysql php5-curl php5-cli php5-cgi php5-dev -y && sudo a2enmod rewrite expires headers mime deflate filter && sudo service apache2 restart && sudo apt-get install phpmyadmin -y && sudo apt-get install vim -y && sudo apt-get install git-core git-gui git-doc -y && cd ~ && mkdir ~/.ssh
cd ~/.ssh && ssh-keygen -t rsa -C "ryan@digitalbrands.com" && git config --global user.name "Ryan Frankel" && git config --global user.email "ryan@digitalbrands.com"
sudo apt-add-repository ppa:chris-lea/node.js -y && sudo apt-get update && sudo apt-get install nodejs -y && sudo aptitude install npm -y && sudo npm install -g less && git clone https://gi
@rxaviers
rxaviers / gist:7360908
Last active July 17, 2024 18:16
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@alan-mushi
alan-mushi / json_parser.c
Last active March 25, 2024 19:23
Examples for the json-c tutorial.
/*
* A simple example of json string parsing with json-c.
*
* clang -Wall -g -I/usr/include/json-c/ -o json_parser json_parser.c -ljson-c
*/
#include <json.h>
#include <stdio.h>
int main() {
struct json_object *jobj;
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active July 15, 2024 06:39
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@kevinmehall
kevinmehall / node-gyp-cross.sh
Created January 30, 2015 21:15
node-gyp cross-compile
#!/bin/bash
set -e
if [ ! -d "$STAGING_DIR" ]; then
echo "STAGING_DIR needs to be set to your cross toolchain path";
exit 1
fi
ARCH=${ARCH:-mipsel}
NODE=${NODE:-0.10.33}
@eatonphil
eatonphil / functions.c
Last active May 15, 2024 02:12
Introduction to "Fun" C (using GCC)
/**
* This are a collection of examples for C 201.
* These combine concepts you may or may not be
* familiar with and are especially useful for
* students new to C. There is a lot of really
* cool stuff you can do in C without any cool
* languages.
*
* This is file in particular is an introduction
* to fun function usage in C.
@bruce30262
bruce30262 / ARMDebianUbuntu.md
Last active June 12, 2023 11:43 — forked from Liryna/ARMDebianUbuntu.md
Emulating ARM on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

If there's no qemu-arm-static in the package list, install qemu-user-static instead