Skip to content

Instantly share code, notes, and snippets.

@ChanderG
ChanderG / main.lisp
Created April 9, 2024 12:34
Fork/Exec in CL using CFFI
;(ql:quickload "cffi")
(require :cffi)
(defcfun "fork" :int)
(defcfun "execvp" :int
(file :string)
(argv (:pointer :string)))
(defun test ()
(let ((pid (fork)))
@ChanderG
ChanderG / instructions.md
Created January 29, 2018 13:48
Custom fonts for use with urxvt

Getting the font

  1. Get fonts folder. Put the TTF subfolder into ~/.local/share/fonts/
  2. Run : fc-cache -f -v
  3. Check: fc-list | grep "name of font"

Instructions obtained from https://github.com/source-foundry/Hack

Using with URXVT

@ChanderG
ChanderG / gist:c8be9bc93aa746c17cd15b7aa1dc8c32
Created December 29, 2017 10:20
Umbrella equivalent to query selector
Vanilla: document.querySelector("#someid")
Umbrella: u('#someid').first()
With regards to use in CellJS, query selector can be used to get hold of a cell/subcell and then run a function within it.
@ChanderG
ChanderG / .tmux.conf
Last active August 29, 2015 14:21
.tmux.conf
# change binder to tilda
# NOT OK -> marking in vim becomes difficult
# TODO: find a suitable single key replacement ( maybe ALT)
unbind C-b
set -g prefix `
bind ` send-prefix
# Start numbering at 1
set -g base-index 1
@ChanderG
ChanderG / Syscall_readme.md
Last active August 29, 2015 14:05
Hello World for syscall in assembly

#Very Important Instructions for this file

A simple hello world x86 program demonstrating syscalls.

###Build Instructions: You need to run the cpp to convert the .S file to .s file. Then instead of manually assembling and linking the file, you can run cc as shown.

###Main vs _start Here note the use of the 'dont include std lib' flag. This is because we do not have a main but a direct _start. If you want to use main instead, replace all instances of _start with main and remove this flag. It should work the same.

@ChanderG
ChanderG / commands.txt
Created July 15, 2014 13:27
Checking if pull is needed - not yet verified
git remote update
git status -uno
@ChanderG
ChanderG / jsbin.doceq.html
Created June 20, 2014 11:09
One-Many Ember Data Relationship (Fixture Adapter)
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<meta charset=utf-8 />
<title>JS Bin</title>
<script src="http://code.jquery.com/jquery-2.0.2.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script>
<script src="http://builds.emberjs.com/tags/v1.5.0/ember.js"></script>
<script src="http://builds.emberjs.com/beta/ember-data.js"></script>
@ChanderG
ChanderG / jsbin.doceq.html
Created June 20, 2014 11:08
Many-Many relations EmberData (Fixture adapters)
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<meta charset=utf-8 />
<title>JS Bin</title>
<script src="http://code.jquery.com/jquery-2.0.2.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script>
<script src="http://builds.emberjs.com/tags/v1.5.0/ember.js"></script>
<script src="http://builds.emberjs.com/beta/ember-data.js"></script>
@ChanderG
ChanderG / jsbin.doceq.html
Last active August 29, 2015 14:02
One-One creation and updation (fixture adapters)
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<meta charset=utf-8 />
<title>JS Bin</title>
<script src="http://code.jquery.com/jquery-2.0.2.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script>
<script src="http://builds.emberjs.com/tags/v1.5.0/ember.js"></script>
<script src="http://builds.emberjs.com/beta/ember-data.js"></script>
@ChanderG
ChanderG / inject-store-into-view.js
Last active August 29, 2015 14:02
Injecting store into views (say) in EmberJS applications using EAK
//this file goes into app/initializers/
//same logic for injecting into other stuff
//tested
export default {
name: "injectStoreIntoView",
after: "store",
initialize: function(container, application) {
container.typeInjection('view', 'store', 'store:main');