Skip to content

Instantly share code, notes, and snippets.

View elfrank's full-sized avatar
🦄

Francisco Avila Beltran elfrank

🦄
View GitHub Profile
@elfrank
elfrank / work_on_fork.md
Created December 10, 2014 06:19
How to work on your own fork

#How to work on your own fork

Let's assume you belong to an organization called justiceleague and that you're supposed to submit code to the earth repository. Since I am batman, I do it like this:

  • Go to https://github.com/justiceleague/earth and click on the fork button on the top right corner. Wait until github completes the copy.
  • Now, it's time to clone the repository and to add both remotes.
git clone git@github.com:justiceleague/earth.git -o upstream
cd earth
git remote add origin git@github.com:batman/earth.git
@elfrank
elfrank / collaborate_on_branches.md
Last active May 7, 2024 00:29
How to work on someone else's branch

#How to work on someone else's branch

Let's assume you need to collaborate with Batman on his forked repository.

  • First, you need to add his fork as a remote.
git remote add batman git@github.com:batman/iambatman.git
  • Now, you can fetch, pull and push to his fork (if you have permissions to do so).
@elfrank
elfrank / line_count
Created October 13, 2013 19:00
How to count all lines of code in a directory (recursively)
find . -name '*.*' | xargs wc -l
@elfrank
elfrank / Steps.txt
Last active December 21, 2015 18:39
-------------------------
Steps
-------------------------
sudo sh /usr/hover/bin/scripts/xvfb start
bash /usr/hover/bin/scripts/start_browser.sh -f 0 -s 1024,768 -u "http://localhost:3000/building_images/scene?building_id=17&framebuffer_id=0" &
bash /usr/hover/bin/scripts/capture_framebuffer.sh -f 0 -n /usr/hover/bin/scripts/screenshot.jpg
bash /usr/hover/bin/scripts/stop_browser.sh
# find string recursively on files contained in a directory
grep -iR "STRING_TO_SEARCH" --color --exclude-dir={"\DIR_1","\DIR_2","\DIR3"} /PATH
grep -iR "" --color --exclude-dir={"\log","\storage","\.git","\tmp"} /usr/hover/sources/prometheus
@elfrank
elfrank / ipfw-connection
Last active December 14, 2015 06:19
simulate network latency and lower bandwidth
# display current rules
sudo ipfw show
# create pipe with preferred settings
sudo ipfw pipe 1 config delay 10ms bw 256kbit/s
sudo ipfw add pipe 1 dst-ip 127.0.0.1 dst-port 8000
# flush all the rules
sudo ipfw flush
StructuredBuffer<int> g_Permutations : register(t0);
StructuredBuffer<int> g_List : register(t1);
RWStructuredBuffer<int> g_ChunksBuffer : register (u0);
RWStructuredBuffer<int> g_MergeBuffer : register (u1);
#define GROUP_SIZE_X 2
#define GROUP_SIZE_Y 2
#define NUM_THREADS_X 2
#define NUM_THREADS_Y 2
/*The idea is to launch just enough threads to ?ll the machine;
CUDA occupancy calculator can tell the correct number of threads.
Launching a few too many is not a problem as the extra threads exit
immediately. The following code assumes warp and block widths
of 32.*/
// global variables
const int B = 3*32; // example batch size
const int globalPoolRayCount;
int globalPoolNextRay = 0;
__global__ void kernel()
@elfrank
elfrank / Remove .DS_Store
Last active October 6, 2015 17:28
Remove .DS_Store on a folder (Recursive)
sudo find . -name ".DS_Store" -depth -exec rm {} \;