Skip to content

Instantly share code, notes, and snippets.

@danielestevez
danielestevez / gist:2044589
Last active April 13, 2025 23:35
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@danielcompton
danielcompton / gist:9719633
Created March 23, 2014 06:48
Data Science Learning
- [ ] Math
- [ ] Linear Algebra
- [ ] Lay - Linear Algebra
- [ ] 18.06 Linear Algebra
http://www.scotthyoung.com/blog/mit-challenge/#more-link1806
- [ ] Burke Lecture Notes
http://www.math.washington.edu/~burke/crs/407/lectures/
- [ ] Coding The Matrix
http://www.amazon.com/dp/0615880991/?tag=coursera-course198-20
- [ ] Quantifying Uncertainty
@napcs
napcs / JS Loading in web frameworks like Elixir
Last active January 20, 2020 04:05
Per-view JavaScript functions for Phoenix. Keeps things out of global space, allows a page to specifically invoke the JS it needs.
How to load page-specific JS functions and pass values to those functions when JS is loaded below your views.
anonymous
anonymous / test.lua
Created April 12, 2015 16:08
require 'nn'
input = torch.DoubleTensor{4} --input word index
target = torch.DoubleTensor{6,5,4,2} --target word indices. So we have 1 true context ("6") and 3 negative contexts ("5,4,2")
label = torch.DoubleTensor({1,0,0,0}) --the first label is true sample, rest are neg samples
model1 = nn.Sequential()
model1:add(nn.LookupTable(1000,4)) -- word embedding layer, vocab size is 1000 and each word is 50 dimensional
model2 = nn.Sequential()
model2:add(nn.LookupTable(1000,4)) -- context embedding layer, this will be dot producted with an element of the word embedding layer
@voluntas
voluntas / webrtc.rst
Last active March 28, 2025 06:01
WebRTC コトハジメ
@maartenbreddels
maartenbreddels / qt_and_tornado.py
Created October 1, 2015 10:57
Combining Qt and tornado, both which want to have their own event loop.
__author__ = 'breddels'
"""
Demonstrates combining Qt and tornado, both which want to have their own event loop.
The solution is to run tornado in a thread, the issue is that callbacks will then also be executed in this thread, and Qt doesn't like that.
To fix this, I show how to use execute the callback in the main thread, using a Qt signal/event in combination with Promises.
The output of the program is:
fetch page, we are in thread <_MainThread(MainThread, started 47200787479520)>
response is 191548 bytes, we are in thread <Thread(Thread-1, started daemon 47201018689280)>
the other thread should fulfil the result to this promise, we are in thread <Thread(Thread-1, started daemon 47201018689280)>
@Brainiarc7
Brainiarc7 / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
Last active May 11, 2025 03:18
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".

@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active May 3, 2025 08:56
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@DavidGriffith
DavidGriffith / bootable-flash.txt
Created March 17, 2017 04:21
Debian installer on a USB key with a writable file system.
Debian installer on a USB key with a writable file system.
I couldn't find a concise article about creating a Debian installer USB
key with a writable file system, so here is my take. This assumes you
have an available Linux system. Note that some old BIOSes might not
happily boot USB drives created in this way.
* Install the packages syslinux dosfstools mbr
* Insert the thumb drive and find the device using dmesg
* Install a Master Boot Record to the drive (install-mbr /dev/sdX)
@linw1995
linw1995 / tasks.json
Created August 4, 2017 05:45
VSCode Task.json for Python Traceback.
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [{
"taskName": "Run Python",
"group": {
"kind": "build",
"isDefault": true
},