Skip to content

Instantly share code, notes, and snippets.

@hG3n
hG3n / init.vim
Last active December 22, 2023 16:37
Neovim config
" ===========================================================================
" > GENERAL
" ===========================================================================
scriptencoding utf-8
set enc=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf8,prc
set backspace=indent,eol,start "in case bcksp isnt working well"
set tabstop=4
@hG3n
hG3n / .vimrc-plain
Last active December 22, 2023 16:37
"""""""""""""""""""""""""""
"--- GENERAL SETTINGS ---"
"""""""""""""""""""""""""""
scriptencoding utf-8
set enc=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf8,prc
set backspace=indent,eol,start "in case bcksp isnt working well"
set tabstop=2
@hG3n
hG3n / .zshrc
Last active December 22, 2023 16:40
# ---------------------------- #
# --- GENERAL ZSH SETTINGS --- #
# ---------------------------- #
ZSH=$HOME/.zsh # Path to zsh_cfg.sh
ZSH_THEME="agnoster" # chosen theme
source $ZSH/zsh_cfg.sh # laod zsh config file
# path settings
@prasanthj
prasanthj / lirc-pi3.txt
Last active January 5, 2023 01:35
Getting lirc to work with Raspberry Pi 3 (Raspbian Stretch)
Notes to make IR shield (made by LinkSprite) work in Raspberry Pi 3 (bought from Amazon [1]).
The vendor has some documentation [2] but that is not complete and sufficient for Raspbian Stretch.
Following are the changes that I made to make it work.
$ sudo apt-get update
$ sudo apt-get install lirc
# Add the following lines to /etc/modules file
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17
@hG3n
hG3n / include-html.directive.ts
Last active February 27, 2018 12:56
directive to include an external html file into an existing dom-element
import {Directive, ElementRef, Input, OnChanges, OnInit} from '@angular/core';
import 'rxjs/add/operator/map';
import {HttpClient, HttpErrorResponse} from "@angular/common/http";
@Directive({
selector: '[includeHtml]'
})
export class IncludeHtmlDirective implements OnInit, OnChanges {
@ericdke
ericdke / notification.swift
Created October 10, 2014 21:01
Deliver an OSX notification with Swift
func showNotification() -> Void {
var notification = NSUserNotification()
notification.title = "Test from Swift"
notification.informativeText = "The body of this Swift notification"
notification.soundName = NSUserNotificationDefaultSoundName
NSUserNotificationCenter.defaultUserNotificationCenter().deliverNotification(notification)
}
//showNotification()
@jdewit
jdewit / vim74_lua
Last active January 30, 2024 04:57
Installing vim 7.4 with lua on Ubuntu 12.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim
sudo rm /usr/bin/vim
@paulkaplan
paulkaplan / gist:5770247
Last active October 12, 2021 01:43
Orbit Controls with momentum and damping for THREE.js
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
*
* customized for momentum (zoom and phi/delta) by paulkaplan
*/
THREE.OrbitControls = function ( object, domElement ) {
@cjgiridhar
cjgiridhar / tornadorequesthandler.py
Created August 6, 2012 14:11
Tornado - POST Request Handler
import tornado.ioloop
import tornado.web
class Hello(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
class User(tornado.web.RequestHandler):
def get(self):