Skip to content

Instantly share code, notes, and snippets.

View elliotchance's full-sized avatar
🤓
Building awesome stuff with V

Elliot Chance elliotchance

🤓
Building awesome stuff with V
View GitHub Profile
void A()
{
B();
C();
}
void B()
{
int *v = malloc(sizeof(int));
if(NULL == v) {
.globl _EaglePlan_getNextPageNumber
.align 4, 0x90
_EaglePlan_getNextPageNumber: ## @EaglePlan_getNextPageNumber
.cfi_startproc
Lfunc_begin14:
.loc 1 263 0 ## /Users/elliot/Xcode/eagle/eagle/eagle/EaglePlan.c:263:0
## BB#0:
pushq %rbp
Ltmp214:
.cfi_def_cfa_offset 16
<?xml version="1.0"?>
<testsuites errors="0" failures="0" tests="392" name="">
<testsuite errors="0" failures="0" tests="116" name="MainSuite">
<testcase classname="" name="EagleObject_equals" time="0"/>
<testcase classname="" name="EagleLogger_GetLogFile" time="0"/>
<testcase classname="" name="EagleUtils_CompareWithoutCase" time="0"/>
<testcase classname="" name="EagleLinkedList_isEmpty" time="0"/>
<testcase classname="" name="EagleLinkedList_begin" time="0"/>
<testcase classname="" name="EagleLinkedList_end" time="0"/>
<testcase classname="" name="EagleLinkedListItem_Delete" time="0"/>
@elliotchance
elliotchance / .vimrc
Last active August 7, 2017 01:17
My vimrc
" INSTALL (run this):
" cd ~ && curl -s https://gist.github.com/elliotchance/5801752/download | tar -x --strip-components=1 && cat .vimrc | grep '^\"% ' .vimrc | cut -c 3- | bash
" Lines started with % will be executed on install:
"
"% # install ctags-exuberant
"% if [ ! -f /usr/local/bin/ctags ]; then
"% wget http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz
"% tar -zxf ctags-5.8.tar.gz
"% cd ctags-5.8 && ./configure && make && sudo make install && sudo rm -f /usr/bin/ctags && sudo ln -s /usr/local/bin/ctags /usr/bin/ctags && cd ..
public boolean compareLists(int[] list1, int[] list2, int allowedFailures = 1)
{
if(list1.length != list2.length) {
return false;
}
int len = list1.length;
boolean[] checklist = new boolean[len];
int allowedFailures = 1, encounteredFailures = 0;
[root@ip-172-32-11-33 DEV htdocs]$ time ./vendor/squizlabs/php_codesniffer/scripts/phpcs -p -n --standard=CodeStandard.xml lib --report=gitblame -s
E.EEE......E......E...EEE.E...E.EE.E.....E..EEEEE..E........ 60 / 181
.........E..EEEEE..E.EE..E.E....E.....E.........EEEEEEEEE... 120 / 181
...........E.E.E.....E......................E.E..E...E.E...E 180 / 181
E
PHP CODE SNIFFER GIT BLAME SUMMARY
--------------------------------------------------------------------------------
AUTHOR SOURCE (Author %) (Overall %) COUNT
@elliotchance
elliotchance / main.cpp
Last active November 2, 2021 06:20
Easily customise how verbose googletest is with unit test results.
#include "gtest/gtest.h"
using namespace testing;
class ConfigurableEventListener : public TestEventListener
{
protected:
TestEventListener* eventListener;
@elliotchance
elliotchance / example.txt
Last active January 3, 2016 18:29
Use the pretty dot-formatted unit test output for googletest like PHPUnit / rspec.
Produces an output like (will use the full available screen width):
............................................................ 60 / 1136 ( 5%)
............................................................ 120 / 1136 ( 10%)
...........F................................................ 180 / 1136 ( 15%)
............................................................ 240 / 1136 ( 21%)
............................................................ 300 / 1136 ( 26%)
............................................................ 360 / 1136 ( 31%)
............................................................ 420 / 1136 ( 36%)
............................................................ 480 / 1136 ( 42%)
@elliotchance
elliotchance / result.txt
Created July 24, 2015 02:13
in_array() vs array_key_exists()
Time shows total time for 1024 iterations
Size | in_array | array_key_exists
1 | 0.000 | 0.000
2 | 0.001 | 0.000
4 | 0.001 | 0.000
8 | 0.001 | 0.001
16 | 0.001 | 0.000
32 | 0.001 | 0.000
64 | 0.001 | 0.000
@elliotchance
elliotchance / NSString+Split.h
Created August 21, 2015 07:15
NSString+Split
#import <Foundation/Foundation.h>
@interface NSString (Split)
- (NSArray *)componentsSeparatedByString:(NSString *)separator
limit:(NSUInteger)limit;
@end