Skip to content

Instantly share code, notes, and snippets.

View mandyedi's full-sized avatar
🙂

Eduard Mandy mandyedi

🙂
View GitHub Profile
@jesperdj
jesperdj / vecmath.hpp
Created June 10, 2011 17:51
Simple vector math classes with SSE-optimized implementation (C++).
/*
* Copyright 2011 Jesper de Jong
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@snikch
snikch / gist:3661188
Created September 6, 2012 23:16
Find the current top view controller for your iOS application
- (UIViewController *)topViewController{
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController];
}
- (UIViewController *)topViewController:(UIViewController *)rootViewController
{
if (rootViewController.presentedViewController == nil) {
return rootViewController;
}
@mikesart
mikesart / gist:6832418
Last active January 30, 2023 04:58
SSE/AVX/MMX test code
// Output from my cmake VERBOSE=1 command for building:
// c++ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -march=native -g -O0 -std=c++0x -g -o sse.cpp.o -c sse.cpp
// c++ -march=native -g -O0 -std=c++0x -g sse.cpp.o -o sse -rdynamic -ldl -lpthread
// SSE
//
#include <stdio.h>
#include <stdlib.h>
// #include <mmintrin.h> // MMX
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active September 15, 2024 20:33
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@Chaser324
Chaser324 / GitHub-Forking.md
Last active November 14, 2024 08:32
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@miguelcma
miguelcma / DeviceUID.m
Created May 25, 2015 15:09
iOS Unique Device ID that persists between app reinstalls
/* DeviceUID.h
#import <Foundation/Foundation.h>
@interface DeviceUID : NSObject
+ (NSString *)uid;
@end
*/
// Device.m
@dhammikamare
dhammikamare / Contest_Guide.md
Last active June 25, 2024 17:46 — forked from shashank21j/Contest_Guide.md
Tutorial for create your own contest on HackerRank.
@amoilanen
amoilanen / tabs2spaces.py
Created January 29, 2016 15:50
Python script to replace tabs with spaces recursively for all files matching a specified file mask regex, the number of spaces if configurable
#
# Usage:
#
# python tabs2spaces.py . 2 .*\.js$
#
import argparse
import os
import re
parser = argparse.ArgumentParser(description='Replace tabs with spaces.')
@somahargitai
somahargitai / LearningProg2.MD
Last active September 23, 2019 03:18
Start learning programming - a very short introduction

How to start programming

the following introduction is based on my personal thoughts about learning to code. If you use it, please make sure to go through all its steps. I went into details only when it was necessary - usually the linked sources are more than enough.

Learn Code

First thing should be to learn the very basic terms of programming: variable, type/data structure, array/list, if, for loop, while loop, function/method, class. There are many different sources for these basics, my recommendation is Codecademy. After a short registration you can open the catalog and browse the free trainings.
Choose beginner training of Java or Python. These are the most-used languages today (with Javascript - but let's learn about that later), sooner or later you will need both of them. Python is faster to learn, you can write shorter code for a task. Java is very exact, in the beginning there will be some things you don'

@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active November 17, 2024 11:21
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent